Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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" };
      },
    });
  • 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";

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/exponentlabshq/stacks-clarity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server