recommend_tool
Recommends the appropriate Fabric pattern tool based on your task description to enable AI-driven pattern execution within Cline workflows.
Instructions
Recommends the best Fabric pattern tool for a given task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The user's task description |
Implementation Reference
- src/index.ts:92-135 (handler)The handler logic for executing the 'recommend_tool'. It extracts the task from input, simulates a Perplexity recommendation (currently hardcoded to 'summarize'), and returns the recommended tool name.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 (registration)Registers the 'recommend_tool' in the ListTools response by adding it to the tools array, including its description and input schema.// 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"] } });