recommend_tool
Identifies the optimal Fabric pattern tool for your task by analyzing input descriptions, simplifying tool selection within the Fabric MCP Server environment.
Instructions
Recommends the best Fabric pattern tool for a given task
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The user's task description |
Input Schema (JSON Schema)
{
"properties": {
"input": {
"description": "The user's task description",
"type": "string"
}
},
"required": [
"input"
],
"type": "object"
}
Implementation Reference
- src/index.ts:92-135 (handler)Handler logic for the 'recommend_tool' within the CallToolRequestSchema request handler. It processes the input task and returns a recommended Fabric pattern tool (currently hardcoded to 'summarize').if (request.params.name === "recommend_tool") { const task = String(request.params.arguments?.input || ''); // Use Perplexity to recommend a Fabric pattern // Call the Perplexity MCP server to search for the best Fabric pattern let recommendedTool = "summarize"; // default tool try { const perplexityResult = await new Promise<any>((resolve, reject) => { //server.accessResource({ // serverName: "github.com/pashpashpash/perplexity-mcp", // uri: `search?query=Recommend the best Fabric pattern tool for the task: ${task}. Choose from the following patterns: ${patterns.join(', ')}&detail_level=brief` //}).then((result: any) => { // console.error('Perplexity recommendation:', result); // if (result && result.content && result.content[0] && result.content[0].text) { // recommendedTool = result.content[0].text; // } else { // console.error("Unexpected result format from perplexity-mcp:", result); // } // resolve(result); //}).catch((error: any) => { // console.error("Error calling perplexity-mcp:", error); // reject(error); //}); console.error("Calling perplexity-mcp to recommend a tool"); recommendedTool = "summarize"; resolve({content: [{text: "summarize"}]}); }); return { content: [{ type: "text", text: `Recommended tool: ${recommendedTool}` }] }; } catch (error) { console.error("Error calling perplexity-mcp:", error); return { content: [{ type: "text", text: `Error calling perplexity-mcp: ${error}` }] }; } }
- src/index.ts:68-82 (schema)Schema definition and registration of the 'recommend_tool' in the ListToolsRequestSchema handler, including input schema requiring a 'input' string.// Add the recommend_tool tools.push({ name: "recommend_tool", description: "Recommends the best Fabric pattern tool for a given task", inputSchema: { type: "object", properties: { input: { type: "string", description: "The user's task description" } }, required: ["input"] } });