{"modulePath":"github.com/github/github-mcp-server/v2","version":"v2.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Variables\n\n```go\nvar (\n\tErrMissingAuthorizationHeader     = fmt.Errorf(\"%w: missing required Authorization header\", mark.ErrBadRequest)\n\tErrBadAuthorizationHeader         = fmt.Errorf(\"%w: Authorization header is badly formatted\", mark.ErrBadRequest)\n\tErrUnsupportedAuthorizationHeader = fmt.Errorf(\"%w: unsupported Authorization header\", mark.ErrBadRequest)\n)\n```\n\n## Functions\n\n```go\nfunc NewToolResultAwaitingFormSubmission(message string) *mcp.CallToolResult\n```\nNewToolResultAwaitingFormSubmission signals to the agent that a tool call has been intercepted to show an MCP App form to the user and has NOT performed the requested operation. The agent must stop, not chain dependent tool calls, and not claim the operation succeeded. The result is marked IsError=true so agents that bail on error don't proceed; the host still renders the UI because rendering is keyed off the tool's \\_meta.ui, not the result. The MCP App form will submit the operation directly when the user clicks submit, after which a ui/update-model-context call delivers the real outcome to the agent.\n\n```go\nfunc NewToolResultError(message string) *mcp.CallToolResult\n```\n\n```go\nfunc NewToolResultErrorFromErr(message string, err error) *mcp.CallToolResult\n```\n\n```go\nfunc NewToolResultResource(message string, contents *mcp.ResourceContents) *mcp.CallToolResult\n```\n\n```go\nfunc NewToolResultResourceLink(message string, link *mcp.ResourceLink) *mcp.CallToolResult\n```\n\n```go\nfunc NewToolResultText(message string) *mcp.CallToolResult\n```\n\n## Types\n\n```go\ntype APIHost struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (a APIHost) AuthorizationServerURL(_ context.Context) (*url.URL, error)\n```\n\n```go\nfunc (a APIHost) BaseRESTURL(_ context.Context) (*url.URL, error)\n```\nAPIHostResolver implementation\n\n```go\nfunc (a APIHost) GraphqlURL(_ context.Context) (*url.URL, error)\n```\n\n```go\nfunc (a APIHost) RawURL(_ context.Context) (*url.URL, error)\n```\n\n```go\nfunc (a APIHost) UploadURL(_ context.Context) (*url.URL, error)\n```\n\n```go\ntype APIHostResolver interface {\n\tBaseRESTURL(ctx context.Context) (*url.URL, error)\n\tGraphqlURL(ctx context.Context) (*url.URL, error)\n\tUploadURL(ctx context.Context) (*url.URL, error)\n\tRawURL(ctx context.Context) (*url.URL, error)\n\tAuthorizationServerURL(ctx context.Context) (*url.URL, error)\n}\n```\n\n```go\nfunc NewAPIHost(s string) (APIHostResolver, error)\n```\n\n```go\ntype HostType int\n```\nHostType identifies which GitHub deployment a host refers to. Tools use this to skip capabilities that only exist on some deployments.\n\n```go\nconst (\n\tHostTypeDotcom HostType = iota\n\tHostTypeGHEC\n\tHostTypeGHES\n)\n```\n\n```go\nfunc ParseHostType(s string) (HostType, error)\n```\nParseHostType classifies a host string. An empty string means github.com, matching NewAPIHost. It returns an error only when the string is not a URL with a scheme.\n\n```go\ntype TokenType int\n```\n\n```go\nconst (\n\tTokenTypeUnknown TokenType = iota\n\tTokenTypePersonalAccessToken\n\tTokenTypeFineGrainedPersonalAccessToken\n\tTokenTypeOAuthAccessToken\n\tTokenTypeUserToServerGitHubAppToken\n\tTokenTypeServerToServerGitHubAppToken\n)\n```\n\n```go\nfunc ParseAuthorizationHeader(req *http.Request) (tokenType TokenType, token string, _ error)\n```\nParseAuthorizationHeader parses the Authorization header from the HTTP request\n\n","path":"github.com/github/github-mcp-server/v2/pkg/utils","name":"utils","synopsis":"","isRedistributable":true}
