You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add structured output schemas to read-only tools
Add TypedRegisterFunc to ServerTool that uses mcp.AddTool[In, Out]()
for typed tool registration. The SDK auto-generates OutputSchema from
the Go Out type and populates StructuredContent on tool results,
while preserving existing TextContent for backwards compatibility.
Tools updated with typed structured output:
- get_me (MinimalUser)
- list_issues (MinimalIssuesResponse)
- list_pull_requests (ListPullRequestsResult)
- search_issues (IssueSearchResult)
- search_pull_requests (PullRequestSearchResult)
- search_code (CodeSearchResult)
Tools like issue_read and pull_request_read keep Out=any since they
are multi-method tools returning different shapes per method.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
// Check if someone tried to use page-based pagination instead of cursor-based
1507
1521
if_, pageProvided:=args["page"]; pageProvided {
1508
-
returnutils.NewToolResultError("This tool uses cursor-based pagination. Use the 'after' parameter with the 'endCursor' value from the previous response instead of 'page'."), nil, nil
1522
+
returnutils.NewToolResultError("This tool uses cursor-based pagination. Use the 'after' parameter with the 'endCursor' value from the previous response instead of 'page'."), MinimalIssuesResponse{}, nil
1509
1523
}
1510
1524
1511
1525
// Check if pagination parameters were explicitly provided
0 commit comments