get_clarity_book
Access comprehensive Clarity language documentation covering all language features, syntax, and best practices for Stacks blockchain development.
Instructions
Get the complete Clarity Book - comprehensive Clarity language documentation covering all language features, syntax, and best practices.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/utils/index.ts:211-221 (handler)Core handler function that reads the Clarity Book content from stacks-clarity-standards/clarity_book.txt and returns it as a string, with error handling.export const getClarityBook = async (): Promise<string> => { try { const bookPath = pathJoin(stacksClarityStandardsDir, "clarity_book.txt"); if (!fs.existsSync(bookPath)) { return "Clarity Book not found at clarity_book.txt"; } return await readFile(bookPath, "utf-8"); } catch (error) { return `Error reading Clarity Book: ${error}`; } };
- src/server.ts:78-86 (registration)Tool registration in MCP server, including name, description, input schema (empty object), and execute handler that invokes getClarityBook and formats response.server.addTool({ name: "get_clarity_book", description: "Get the complete Clarity Book - comprehensive Clarity language documentation covering all language features, syntax, and best practices.", parameters: z.object({}), execute: async () => { const book = await getClarityBook(); return { text: book, type: "text" }; }, });
- src/server.ts:81-81 (schema)Zod schema definition for tool inputs: empty object (no parameters required).parameters: z.object({}),
- src/server.ts:7-16 (registration)Import statement bringing getClarityBook handler into server.ts for use in tool registration.import { readAllMarkdownFromDirectories, readMarkdownFromDirectory, getAvailableSIPs, getSIPContent, searchSIPs, getClarityBook, getSIPsWithClarityCode, getTokenStandardSIPs, } from "./utils/index.js";