Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResult ¶
func ErrorResult(msg string) *mcpsdk.CallToolResult
ErrorResult creates a CallToolResult with IsError set, containing the given error message.
func JSONResult ¶
func JSONResult(v any) (*mcpsdk.CallToolResult, error)
JSONResult creates a CallToolResult containing the JSON-encoded value as text content. This is the standard way to return structured data from a tool handler.
func TextResult ¶
func TextResult(msg string) *mcpsdk.CallToolResult
TextResult creates a CallToolResult containing a plain text message.
func TranslateAPIError ¶
TranslateAPIError converts a Hookdeck API error into a human-readable message suitable for returning to an MCP client. If the error is not an *hookdeck.APIError, the original error message is returned unchanged.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps the MCP SDK server and the Hookdeck API client.
func NewServer ¶
NewServer creates an MCP server with all Hookdeck tools registered. The supplied client is shared across all tool handlers; changing its ProjectID (e.g. via the projects.use action) affects subsequent calls within the same session.
When the client has no API key (unauthenticated), the server additionally registers a hookdeck_login tool that initiates browser-based device auth. Resource tool handlers will return an auth error until login completes.