Repository navigation
fix(mcp): discover tool schemas in the calling session - #12
Merged
Merged
Conversation
akazwz
approved these changes
Oct 1, 2026
akazwz
left a comment
Member
There was a problem hiding this comment.
LGTM,这个修复可以先合。后面可以单独看看怎么复用工具 schema 和协议发现结果,减少每次调用前的额外请求。
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repository-scoped GitHub tools failed with HTTP 400 / JSON-RPC -32020 when their arguments had
x-mcp-headerannotations. Calls such asget_meand query-only searches still succeeded.Connect-It discovers tools in one MCP session, then opens a fresh session for each execution. Go SDK v1.7.0 derives parameter headers from the calling session's tool cache, so those execution sessions omitted the required headers.
tools/list.This follows the diagnostic groundwork in #11. Refs felinics/Memoh#1384.
Validation
Validated at
0580db867fe3bdbc3de8cf1cc9af4a8dd3d079d8:Mcp-Param-Ownerheader. The PostgreSQL-backed API regression also failed before the fix; both pass after it.GOFLAGS=-count=1 mise run testwithTEST_DATABASE_URLset to disposable PostgreSQL: all Go modules passed.go test -race ./mcpclient ./exec -count=1inpackages/service, andgo test -race ./... -count=1inpackages/api: passed, with database integration enabled.go vetandgit diff --check: passed.get_teamsHTTP 403 remains an authentication/permission failure. No additional permissions were granted.Trade-off and rollout
Modern-protocol executions add a tools/list request, or enough pages to find the tool, within the existing timeout. No cross-call cache was added.
Only the local test deployment was updated. Cloud rollout and original-reporter acceptance remain outstanding, so this PR does not auto-close the Memoh issue. OAuth credentials, local deployment files, and temporary probe outputs are excluded.
Human QA