Skip to main content
Glama

search_sips

Search through Stacks Improvement Proposals (SIPs) to find blockchain standards and specifications matching your query for smart contract development.

Instructions

Search through all SIPs for content matching a specific query. Useful for finding standards related to specific topics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., 'fungible token', 'NFT', 'metadata', 'cost analysis')

Implementation Reference

  • Core handler function that implements the SIP search logic: iterates through all available SIPs, fetches each one's content, and returns SIP numbers matching the query.
    export const searchSIPs = async (query: string): Promise<string[]> => {
      const sips = getAvailableSIPs();
      const results: string[] = [];
      
      for (const sipNum of sips) {
        const content = await getSIPContent(sipNum);
        if (content.toLowerCase().includes(query.toLowerCase())) {
          results.push(sipNum);
        }
      }
      
      return results;
    };
  • src/server.ts:98-115 (registration)
    Registers the 'search_sips' MCP tool, including name, description, Zod input schema, and execute handler that calls the searchSIPs function and formats results.
    server.addTool({
      name: "search_sips",
      description: "Search through all SIPs for content matching a specific query. Useful for finding standards related to specific topics.",
      parameters: z.object({
        query: z.string().describe("Search query (e.g., 'fungible token', 'NFT', 'metadata', 'cost analysis')"),
      }),
      execute: async (args) => {
        const results = await searchSIPs(args.query);
        if (results.length === 0) {
          return { text: `No SIPs found matching '${args.query}'`, type: "text" };
        }
        const resultList = results.map(num => `- SIP-${num.padStart(3, "0")}`).join("\n");
        return { 
          text: `SIPs matching '${args.query}':\n${resultList}\n\nUse get_sip with the SIP number to retrieve full content.`, 
          type: "text" 
        };
      },
    });
  • Zod schema defining the input parameter 'query' as a string for the search_sips tool.
    parameters: z.object({
      query: z.string().describe("Search query (e.g., 'fungible token', 'NFT', 'metadata', 'cost analysis')"),
    }),
  • Helper function getSIPContent used by searchSIPs to fetch the full content of a SIP (markdown docs and Clarity code) for search matching.
    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}`;
      }
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions searching 'all SIPs' and being 'useful for finding standards,' but lacks details on how results are returned (e.g., format, pagination, sorting), error handling, or any rate limits. For a search tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, with two sentences that efficiently convey the tool's purpose and utility. There's no unnecessary information, and each sentence adds value. However, it could be slightly more structured by explicitly separating purpose from usage guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (a search function with one parameter) and no output schema or annotations, the description is adequate but incomplete. It covers the basic purpose and usage but lacks details on behavioral aspects like result format or error handling. For a search tool, this leaves room for improvement in providing a complete context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'query' parameter well-documented in the schema. The description adds minimal value beyond this, only reinforcing that it's for 'content matching a specific query' without providing additional syntax, examples, or constraints. Given the high schema coverage, a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search through all SIPs for content matching a specific query.' It specifies the verb ('Search'), resource ('all SIPs'), and scope ('content matching a specific query'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'list_sips' or 'get_sip', which could help avoid confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance: 'Useful for finding standards related to specific topics.' This suggests it's for topic-based searches, but it doesn't explicitly state when to use this tool versus alternatives (e.g., 'list_sips' for browsing all SIPs or 'get_sip' for retrieving a specific SIP by ID). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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