find_stack
Recommends a complete AI harness stack spanning orchestration, memory, guardrails, and evaluation based on your project description.
Instructions
Assemble a complete AI harness stack for a use case. Given a description of what you're building, returns recommended tools across harness layers: orchestration, tools/MCPs, memory, guardrails, context assembly, and evaluation. This is the key differentiator — Unfragile understands that modern AI systems are composed of 5-15 tools working together.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | What you're building (e.g., 'a customer support agent that connects to our Postgres database and Slack, with memory of past conversations') | |
| focus | No | Stack focus: 'full' = all layers, 'tools-only' = just MCPs and integrations, 'infrastructure' = frameworks and platforms | full |
Implementation Reference
- src/index.ts:629-709 (registration)Registration of the 'find_stack' tool on the MCP server with its name, description, and Zod schema for parameters.
server.tool( "find_stack", "Assemble a complete AI harness stack for a use case. Given a description of what you're building, returns recommended tools across harness layers: orchestration, tools/MCPs, memory, guardrails, context assembly, and evaluation. This is the key differentiator — Unfragile understands that modern AI systems are composed of 5-15 tools working together.", { description: z.string().min(10).max(1000).describe("What you're building (e.g., 'a customer support agent that connects to our Postgres database and Slack, with memory of past conversations')"), focus: z.enum(["full", "tools-only", "infrastructure"]).default("full").describe("Stack focus: 'full' = all layers, 'tools-only' = just MCPs and integrations, 'infrastructure' = frameworks and platforms"), }, async ({ description, focus }) => { log("find_stack", description); try { // Parallel queries across harness layers const layers = focus === "tools-only" ? [ { name: "MCP Servers / Tools", query: `MCP server for ${description}`, type: "mcp" as const }, { name: "APIs", query: `API for ${description}`, type: "api" as const }, { name: "Extensions", query: `extension for ${description}`, type: "extension" as const }, ] : focus === "infrastructure" ? [ { name: "Frameworks", query: `framework for ${description}`, type: "framework" as const }, { name: "Platforms", query: `platform for ${description}`, type: "platform" as const }, { name: "CLI Tools", query: `CLI for ${description}`, type: "cli" as const }, ] : [ { name: "Orchestration / Framework", query: `agent framework for ${description}`, type: "framework" as const }, { name: "MCP Servers / Tools", query: `MCP server for ${description}`, type: "mcp" as const }, { name: "APIs", query: `API for ${description}`, type: "api" as const }, { name: "Agents", query: `agent for ${description}`, type: "agent" as const }, { name: "CLI Tools", query: `CLI tool for ${description}`, type: "cli" as const }, ]; const results = await Promise.all( layers.map(async (layer) => { try { const data = await searchAPI(layer.query, { limit: 3, type: layer.type }); return { layer: layer.name, matches: data.matches }; } catch { return { layer: layer.name, matches: [] }; } }) ); const lines: string[] = []; lines.push(`# Harness Stack for: ${description}\n`); lines.push(`> Every AI system is a harness — the model is just one component.`); lines.push(`> Here's a recommended stack assembled from the Unfragile match graph.\n`); let totalTools = 0; for (const { layer, matches } of results) { if (matches.length === 0) continue; totalTools += matches.length; lines.push(`## ${layer}\n`); for (const m of matches) { const mName = cleanName(m.artifact.name, m.artifact.url); const verified = m.artifact.verified ? " ✓" : ""; const pricing = m.artifact.pricing.free ? "Free" : m.artifact.pricing.model; lines.push(`**${mName}${verified}** — ${pricing} | Rank: ${m.artifact.unfragileRank}/100`); if (m.artifact.description) lines.push(`${m.artifact.description.slice(0, 200)}`); if (m.capabilities.length > 0) { const capNames = m.capabilities.slice(0, 3).map((c) => c.name).join(", "); lines.push(`Key capabilities: ${capNames}`); } lines.push(`→ ${m.artifact.url}\n`); } } if (totalTools === 0) { lines.push("No matching tools found for this use case. This gap has been recorded — the Unfragile graph learns from every query."); } else { lines.push(`---`); lines.push(`*${totalTools} tools across ${results.filter((r) => r.matches.length > 0).length} harness layers. Every query improves the graph.*`); lines.push(`*Browse more: https://unfragile.ai/hub*`); } return { content: [{ type: "text" as const, text: lines.join("\n") }] }; } catch (err) { return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true }; } } ); - src/index.ts:632-635 (schema)Zod schema defining the input parameters: 'description' (string, 10-1000 chars) and 'focus' (enum: full, tools-only, infrastructure, default full).
{ description: z.string().min(10).max(1000).describe("What you're building (e.g., 'a customer support agent that connects to our Postgres database and Slack, with memory of past conversations')"), focus: z.enum(["full", "tools-only", "infrastructure"]).default("full").describe("Stack focus: 'full' = all layers, 'tools-only' = just MCPs and integrations, 'infrastructure' = frameworks and platforms"), }, - src/index.ts:636-709 (handler)The handler function for 'find_stack'. Based on the focus parameter, it runs parallel searches across harness layers (orchestration/framework, MCP servers, APIs, agents, CLI tools, etc.), then assembles a markdown stack recommendation.
async ({ description, focus }) => { log("find_stack", description); try { // Parallel queries across harness layers const layers = focus === "tools-only" ? [ { name: "MCP Servers / Tools", query: `MCP server for ${description}`, type: "mcp" as const }, { name: "APIs", query: `API for ${description}`, type: "api" as const }, { name: "Extensions", query: `extension for ${description}`, type: "extension" as const }, ] : focus === "infrastructure" ? [ { name: "Frameworks", query: `framework for ${description}`, type: "framework" as const }, { name: "Platforms", query: `platform for ${description}`, type: "platform" as const }, { name: "CLI Tools", query: `CLI for ${description}`, type: "cli" as const }, ] : [ { name: "Orchestration / Framework", query: `agent framework for ${description}`, type: "framework" as const }, { name: "MCP Servers / Tools", query: `MCP server for ${description}`, type: "mcp" as const }, { name: "APIs", query: `API for ${description}`, type: "api" as const }, { name: "Agents", query: `agent for ${description}`, type: "agent" as const }, { name: "CLI Tools", query: `CLI tool for ${description}`, type: "cli" as const }, ]; const results = await Promise.all( layers.map(async (layer) => { try { const data = await searchAPI(layer.query, { limit: 3, type: layer.type }); return { layer: layer.name, matches: data.matches }; } catch { return { layer: layer.name, matches: [] }; } }) ); const lines: string[] = []; lines.push(`# Harness Stack for: ${description}\n`); lines.push(`> Every AI system is a harness — the model is just one component.`); lines.push(`> Here's a recommended stack assembled from the Unfragile match graph.\n`); let totalTools = 0; for (const { layer, matches } of results) { if (matches.length === 0) continue; totalTools += matches.length; lines.push(`## ${layer}\n`); for (const m of matches) { const mName = cleanName(m.artifact.name, m.artifact.url); const verified = m.artifact.verified ? " ✓" : ""; const pricing = m.artifact.pricing.free ? "Free" : m.artifact.pricing.model; lines.push(`**${mName}${verified}** — ${pricing} | Rank: ${m.artifact.unfragileRank}/100`); if (m.artifact.description) lines.push(`${m.artifact.description.slice(0, 200)}`); if (m.capabilities.length > 0) { const capNames = m.capabilities.slice(0, 3).map((c) => c.name).join(", "); lines.push(`Key capabilities: ${capNames}`); } lines.push(`→ ${m.artifact.url}\n`); } } if (totalTools === 0) { lines.push("No matching tools found for this use case. This gap has been recorded — the Unfragile graph learns from every query."); } else { lines.push(`---`); lines.push(`*${totalTools} tools across ${results.filter((r) => r.matches.length > 0).length} harness layers. Every query improves the graph.*`); lines.push(`*Browse more: https://unfragile.ai/hub*`); } return { content: [{ type: "text" as const, text: lines.join("\n") }] }; } catch (err) { return { content: [{ type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}` }], isError: true }; } } );