newMCPTool creates an mcpToolWrapper from an mcp.Tool discovered on a remote server.
( configID uuid.UUID, serverSlug string, tool mcp.Tool, mcpClient *client.Client, modelIntent bool, )
| 519 | // newMCPTool creates an mcpToolWrapper from an mcp.Tool |
| 520 | // discovered on a remote server. |
| 521 | func newMCPTool( |
| 522 | configID uuid.UUID, |
| 523 | serverSlug string, |
| 524 | tool mcp.Tool, |
| 525 | mcpClient *client.Client, |
| 526 | modelIntent bool, |
| 527 | ) *mcpToolWrapper { |
| 528 | return &mcpToolWrapper{ |
| 529 | configID: configID, |
| 530 | prefixedName: serverSlug + toolNameSep + tool.Name, |
| 531 | originalName: tool.Name, |
| 532 | description: tool.Description, |
| 533 | parameters: tool.InputSchema.Properties, |
| 534 | required: tool.InputSchema.Required, |
| 535 | modelIntent: modelIntent, |
| 536 | client: mcpClient, |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | func (t *mcpToolWrapper) Info() fantasy.ToolInfo { |
| 541 | required := t.required |