()
| 538 | } |
| 539 | |
| 540 | func (t *mcpToolWrapper) Info() fantasy.ToolInfo { |
| 541 | required := t.required |
| 542 | if required == nil { |
| 543 | required = []string{} |
| 544 | } |
| 545 | |
| 546 | if !t.modelIntent { |
| 547 | return fantasy.ToolInfo{ |
| 548 | Name: t.prefixedName, |
| 549 | Description: t.description, |
| 550 | Parameters: t.parameters, |
| 551 | Required: required, |
| 552 | Parallel: true, |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | // Wrap original parameters under "properties" and add |
| 557 | // "model_intent" so the LLM provides a human-readable |
| 558 | // description of each tool call. |
| 559 | wrapped := map[string]any{ |
| 560 | "model_intent": map[string]any{ |
| 561 | "type": "string", |
| 562 | "description": "A short, natural-language, present-participle " + |
| 563 | "phrase describing why you are calling this tool. " + |
| 564 | "This is shown to the user as a status label while " + |
| 565 | "the tool runs. Use plain English with no underscores " + |
| 566 | "or technical jargon. Keep it under 100 characters. " + |
| 567 | "Good examples: \"Reading the authentication module\", " + |
| 568 | "\"Searching for configuration files\", " + |
| 569 | "\"Creating a new workspace\".", |
| 570 | }, |
| 571 | "properties": map[string]any{ |
| 572 | "type": "object", |
| 573 | "properties": t.parameters, |
| 574 | "required": required, |
| 575 | }, |
| 576 | } |
| 577 | return fantasy.ToolInfo{ |
| 578 | Name: t.prefixedName, |
| 579 | Description: t.description, |
| 580 | Parameters: wrapped, |
| 581 | Required: []string{"model_intent", "properties"}, |
| 582 | Parallel: true, |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | func (t *mcpToolWrapper) Run( |
| 587 | ctx context.Context, |
no outgoing calls