diff --git a/pkg/github/__toolsnaps__/get_me.snap b/pkg/github/__toolsnaps__/get_me.snap index f62131f7d..e6d02929f 100644 --- a/pkg/github/__toolsnaps__/get_me.snap +++ b/pkg/github/__toolsnaps__/get_me.snap @@ -5,7 +5,8 @@ }, "description": "Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls.", "inputSchema": { - "type": "object" + "type": "object", + "properties": {} }, "name": "get_me" } \ No newline at end of file diff --git a/pkg/github/context_tools.go b/pkg/github/context_tools.go index 36a682f62..3fe622379 100644 --- a/pkg/github/context_tools.go +++ b/pkg/github/context_tools.go @@ -2,6 +2,7 @@ package github import ( "context" + "encoding/json" "time" ghErrors "github.com/github/github-mcp-server/pkg/errors" @@ -43,9 +44,9 @@ func GetMe(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Too Title: t("TOOL_GET_ME_USER_TITLE", "Get my user profile"), ReadOnlyHint: true, }, - InputSchema: &jsonschema.Schema{ - Type: "object", - }, + // Use json.RawMessage to ensure "properties" is included even when empty. + // OpenAI strict mode requires the properties field to be present. + InputSchema: json.RawMessage(`{"type":"object","properties":{}}`), }, mcp.ToolHandlerFor[map[string]any, any](func(ctx context.Context, _ *mcp.CallToolRequest, _ map[string]any) (*mcp.CallToolResult, any, error) { client, err := getClient(ctx)