get_sip
Retrieve complete Stacks Improvement Proposal content by number, including Clarity smart contract code for blockchain development standards.
Instructions
Get the complete content of a specific SIP (Stacks Improvement Proposal) by number, including any Clarity smart contract code.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sipNumber | Yes | The SIP number (e.g., '009' for SIP-009 NFT standard, '010' for SIP-010 FT standard) |
Implementation Reference
- src/server.ts:72-75 (handler)The execute function that implements the core logic of the 'get_sip' tool by calling the getSIPContent helper with the sipNumber argument and formatting the response.execute: async (args) => { const content = await getSIPContent(args.sipNumber); return { text: content, type: "text" }; },
- src/server.ts:69-71 (schema)Zod input schema defining the required 'sipNumber' parameter as a string.parameters: z.object({ sipNumber: z.string().describe("The SIP number (e.g., '009' for SIP-009 NFT standard, '010' for SIP-010 FT standard)"), }),
- src/server.ts:66-76 (registration)Registration of the 'get_sip' tool on the FastMCP server using server.addTool method.server.addTool({ name: "get_sip", description: "Get the complete content of a specific SIP (Stacks Improvement Proposal) by number, including any Clarity smart contract code.", parameters: z.object({ sipNumber: z.string().describe("The SIP number (e.g., '009' for SIP-009 NFT standard, '010' for SIP-010 FT standard)"), }), execute: async (args) => { const content = await getSIPContent(args.sipNumber); return { text: content, type: "text" }; }, });
- src/utils/index.ts:153-189 (helper)Core helper function that reads and formats the content from the SIP directory, including markdown docs and Clarity contract files.export const getSIPContent = async (sipNumber: string): Promise<string> => { try { const sipDir = pathJoin(stacksClarityStandardsDir, `sip-${sipNumber.padStart(3, "0")}`); if (!fs.existsSync(sipDir)) { return `SIP-${sipNumber} directory not found`; } const files = fs.readdirSync(sipDir); const mdFiles = files.filter((file) => file.endsWith(".md")); const clarFiles = files.filter((file) => file.endsWith(".clar")); if (mdFiles.length === 0 && clarFiles.length === 0) { return `No documentation or Clarity files found for SIP-${sipNumber}`; } let content = `# SIP-${sipNumber.padStart(3, "0")}\n\n`; // Read markdown documentation first for (const file of mdFiles) { const filePath = pathJoin(sipDir, file); const fileContent = await readFile(filePath, "utf-8"); content += `## ${file}\n\n${fileContent}\n\n---\n\n`; } // Read Clarity contract files for (const file of clarFiles) { const filePath = pathJoin(sipDir, file); const fileContent = await readFile(filePath, "utf-8"); content += `## Clarity Contract: ${file}\n\n\`\`\`clarity\n${fileContent}\n\`\`\`\n\n---\n\n`; } return content; } catch (error) { return `Error reading SIP-${sipNumber}: ${error}`; } };