Skip to main content
Glama
ProsodyAI

@prosodyai/mcp-docs

Official
by ProsodyAI

Search ProsodyAI docs

search_docs

Search across ProsodyAI documentation, SDKs, recipes, and API reference. Get ranked results with snippets and stable IDs to retrieve full content via read_doc.

Instructions

Search ProsodyAI docs, SDK READMEs, recipes, and OpenAPI metadata. Returns a ranked list of matches with snippets and stable ids. Follow up with read_doc to fetch full content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesFree-text search query.
sectionNoRestrict to a single section: docs | sdks | recipes | api.
limitNoMax results (default 10).

Implementation Reference

  • src/server.ts:56-84 (registration)
    Registration of the 'search_docs' tool on the MCP server, including its metadata (title, description, inputSchema) and handler invocation.
    server.registerTool(
      "search_docs",
      {
        title: "Search ProsodyAI docs",
        description:
          "Search ProsodyAI docs, SDK READMEs, recipes, and OpenAPI metadata. Returns a ranked list of matches with snippets and stable `id`s. Follow up with `read_doc` to fetch full content.",
        inputSchema: {
          query: z.string().min(1).describe("Free-text search query."),
          section: sectionEnum
            .optional()
            .describe("Restrict to a single section: docs | sdks | recipes | api."),
          limit: z.number().int().min(1).max(50).optional().describe("Max results (default 10)."),
        },
      },
      async ({ query, section, limit }) => {
        const results = await searchContent(query, { section, limit });
        if (!results.length) {
          return textResponse(`No matches for "${query}".`);
        }
        const lines = results.map((r, i) =>
          [
            `${i + 1}. [${r.section}] ${r.title}  (id: ${r.id})`,
            `   ${r.description}`,
            `   snippet: ${r.snippet}`,
          ].join("\n"),
        );
        return textResponse(lines.join("\n\n"));
      },
    );
  • Handler function for 'search_docs': calls searchContent with query, optional section filter, and optional limit, then formats results into a text response.
    async ({ query, section, limit }) => {
      const results = await searchContent(query, { section, limit });
      if (!results.length) {
        return textResponse(`No matches for "${query}".`);
      }
      const lines = results.map((r, i) =>
        [
          `${i + 1}. [${r.section}] ${r.title}  (id: ${r.id})`,
          `   ${r.description}`,
          `   snippet: ${r.snippet}`,
        ].join("\n"),
      );
      return textResponse(lines.join("\n\n"));
    },
  • Input schema for 'search_docs': defines 'query' (required string), 'section' (optional enum: docs/sdks/recipes/api), and 'limit' (optional int 1-50).
    inputSchema: {
      query: z.string().min(1).describe("Free-text search query."),
      section: sectionEnum
        .optional()
        .describe("Restrict to a single section: docs | sdks | recipes | api."),
      limit: z.number().int().min(1).max(50).optional().describe("Max results (default 10)."),
    },
  • The searchContent function that performs fuzzy search using Fuse.js over the loaded content entries, supporting section filtering and result limiting. Returns results with score and snippet.
    export async function searchContent(
      query: string,
      options: { section?: ContentSection; limit?: number } = {},
    ): Promise<Array<ContentEntry & { score: number; snippet: string }>> {
      await loadContent();
      if (!fuse) return [];
      const limit = options.limit ?? 10;
      const results = fuse.search(query, { limit: limit * 3 });
      const filtered = options.section
        ? results.filter((r) => r.item.section === options.section)
        : results;
      return filtered.slice(0, limit).map((r) => ({
        ...r.item,
        score: r.score ?? 0,
        snippet: makeSnippet(r.item.body, query),
      }));
    }
  • Helper function makeSnippet that extracts a relevant text snippet around the search query match from the document body.
    function makeSnippet(body: string, query: string): string {
      const lower = body.toLowerCase();
      const idx = lower.indexOf(query.toLowerCase().split(/\s+/)[0] ?? "");
      if (idx === -1) {
        return body.slice(0, 240).trim();
      }
      const start = Math.max(0, idx - 80);
      const end = Math.min(body.length, idx + 200);
      const prefix = start > 0 ? "..." : "";
      const suffix = end < body.length ? "..." : "";
      return prefix + body.slice(start, end).replace(/\s+/g, " ").trim() + suffix;
    }
Behavior3/5

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

With no annotations, description must disclose behavior. It mentions returned items are 'ranked list with snippets and stable ids,' giving output structure. However, it does not detail pagination, rate limits, or error handling, leaving gaps for a search tool.

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

Conciseness5/5

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

Two sentences: first defines purpose and scope, second explains output and next step. No filler, essential information front-loaded.

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

Completeness4/5

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

For a search tool with 3 simple params, description covers purpose, output format, and follow-up. Missing details on pagination or result ordering, but overall complete given tool simplicity and sibling differentiation.

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?

Schema covers all three parameters (query, section, limit) with descriptions. The tool description adds context about return format and follow-up but does not enhance parameter meaning beyond the schema, earning baseline score of 3.

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

Purpose5/5

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

Description starts with 'Search ProsodyAI docs, SDK READMEs, recipes, and OpenAPI metadata.' This clearly states the action (search), the resource (multiple doc types), and is distinct from sibling tools like list_docs and read_doc.

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

Usage Guidelines4/5

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

Explicitly directs to 'Follow up with read_doc to fetch full content,' providing clear context for when to use this tool and suggesting a complementary tool. Lacks explicit when-not-to-use scenarios but adequately guides usage.

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/ProsodyAI/mcp-docs'

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