get_blueprint
Retrieve a specific tech stack blueprint by its unique ID to access pre-configured technology recommendations for development projects.
Instructions
Fetches an existing blueprint by ID. Blueprints are generated via the StacksFinder web UI. Requires API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blueprintId | Yes | Blueprint UUID |
Implementation Reference
- src/tools/blueprint.ts:102-131 (handler)Main handler function that fetches the blueprint from the StacksFinder API using getBlueprintRequest, formats it into a markdown table with project details and selected technologies using formatBlueprint, and handles errors appropriately.export async function executeGetBlueprint( input: GetBlueprintInput ): Promise<{ text: string; isError?: boolean }> { const { blueprintId } = input; debug('Fetching blueprint', { blueprintId }); try { const response = await getBlueprintRequest<BlueprintApiResponse>(blueprintId); const text = formatBlueprint(response); return { text }; } catch (err) { if (err instanceof McpError) { // Add helpful suggestion for NOT_FOUND if (err.code === ErrorCode.NOT_FOUND) { err.suggestions = [ 'Blueprints are generated via the StacksFinder web UI.', 'Visit https://stacksfinder.com to create a new blueprint.' ]; } return { text: err.toResponseText(), isError: true }; } const error = new McpError( ErrorCode.API_ERROR, err instanceof Error ? err.message : 'Failed to fetch blueprint' ); return { text: error.toResponseText(), isError: true }; } }
- src/tools/blueprint.ts:15-17 (schema)Zod input schema validation for the get_blueprint tool, requiring a blueprintId UUID.export const GetBlueprintInputSchema = z.object({ blueprintId: z.string().uuid().describe('Blueprint UUID') });
- src/server.ts:194-212 (registration)MCP server registration of the get_blueprint tool, using the tool definition for name/description, defining JSON input schema, and providing a wrapper handler that validates input with Zod and delegates to executeGetBlueprint.server.registerTool( getBlueprintToolDefinition.name, { title: 'Get Blueprint', description: getBlueprintToolDefinition.description, inputSchema: { blueprintId: z.string().uuid().describe('Blueprint UUID') } }, async (args) => { debug('get_blueprint called', args); const input = GetBlueprintInputSchema.parse(args); const { text, isError } = await executeGetBlueprint(input); return { content: [{ type: 'text', text }], isError }; } );
- src/tools/blueprint.ts:24-39 (registration)Tool definition object used for MCP registration, providing the tool name, description, and JSON Schema for input validation.export const getBlueprintToolDefinition = { name: 'get_blueprint', description: 'Fetches an existing blueprint by ID. Blueprints are generated via the StacksFinder web UI. Requires API key.', inputSchema: { type: 'object' as const, properties: { blueprintId: { type: 'string', format: 'uuid', description: 'Blueprint UUID' } }, required: ['blueprintId'] } };
- src/tools/blueprint.ts:63-97 (helper)Helper function to format the raw API blueprint response into a user-friendly Markdown table showing project details, selected technologies by category, and optional narrative.function formatBlueprint(blueprint: BlueprintApiResponse): string { const projectName = blueprint.projectContext?.projectName || 'Unnamed Project'; const projectType = blueprint.projectContext?.projectType || 'Unknown'; const scale = blueprint.projectContext?.scale || 'mvp'; const createdDate = new Date(blueprint.createdAt).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); let text = `## Blueprint: ${projectName} **ID**: ${blueprint.id} **Type**: ${projectType} **Scale**: ${scale} **Created**: ${createdDate} ### Selected Stack | Category | Technology | |----------|------------| `; for (const tech of blueprint.selectedTechs) { text += `| ${tech.category} | ${tech.technology} |\n`; } if (blueprint.narrative) { text += ` ### Narrative ${blueprint.narrative}`; } return text; }