@@ -5,6 +5,31 @@ import "context"
55// ToolOverride allows replacing a tool's definition based on runtime conditions.
66// Use this for the small number of tools that have different schemas/handlers
77// depending on features, capabilities, or environment.
8+ //
9+ // Example usage:
10+ //
11+ // // Define overrides for tools that have enterprise-specific variants
12+ // overrides := ToolOverrides{
13+ // "create_issue": {
14+ // ToolName: "create_issue",
15+ // Condition: func(ctx context.Context) (bool, error) {
16+ // // Check if enterprise features are enabled for this request
17+ // return isEnterpriseEnabled(ctx), nil
18+ // },
19+ // Override: ServerTool{
20+ // Tool: mcp.Tool{
21+ // Name: "create_issue",
22+ // Description: "Create an issue (Enterprise)",
23+ // InputSchema: enterpriseCreateIssueSchema, // has extra fields
24+ // },
25+ // Handler: enterpriseCreateIssueHandler, // different handler
26+ // },
27+ // },
28+ // }
29+ //
30+ // // Apply overrides after building the base tool list
31+ // tools := index.Materialize(ctx, queryResult)
32+ // tools = overrides.ApplyToTools(ctx, tools)
833type ToolOverride struct {
934 // ToolName is the canonical tool name to override
1035 ToolName string
0 commit comments