Skip to main content
Glama

suggest

Generate autocomplete suggestions for search queries to improve search accuracy and discover related terms.

Instructions

Get autocomplete suggestions for a search query using SearchClaw. Costs 1 credit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesPartial query for autocomplete suggestions

Implementation Reference

  • The 'suggest' tool handler is an async function that takes a 'q' parameter (partial query) and calls the SearchClaw API's /suggest endpoint via apiGet, then wraps the result with jsonResult.
    server.tool(
      "suggest",
      "Get autocomplete suggestions for a search query using SearchClaw. Costs 1 credit.",
      { q: z.string().describe("Partial query for autocomplete suggestions") },
      async ({ q }) => jsonResult(await apiGet("/suggest", { q }))
    );
  • Input schema for the 'suggest' tool - validates that 'q' is a required string parameter representing the partial query for autocomplete suggestions.
    { q: z.string().describe("Partial query for autocomplete suggestions") },
  • src/index.ts:100-105 (registration)
    The 'suggest' tool is registered with the MCP server using server.tool(), providing the tool name, description, input schema, and handler function.
    server.tool(
      "suggest",
      "Get autocomplete suggestions for a search query using SearchClaw. Costs 1 credit.",
      { q: z.string().describe("Partial query for autocomplete suggestions") },
      async ({ q }) => jsonResult(await apiGet("/suggest", { q }))
    );
  • Helper function that makes GET requests to the SearchClaw API. Used by the 'suggest' tool to call the /suggest endpoint with query parameters.
    async function apiGet(path: string, params?: Record<string, string>) {
      const url = new URL(`${API_BASE}${path}`);
      if (params) {
        for (const [key, value] of Object.entries(params)) {
          url.searchParams.set(key, value);
        }
      }
      const controller = new AbortController();
      const timeout = setTimeout(() => controller.abort(), 30000);
      try {
        const response = await fetch(url.toString(), { headers, signal: controller.signal });
        if (!response.ok) {
          const text = await response.text();
          throw new Error(`SearchClaw API error ${response.status}: ${text}`);
        }
        return response.json();
      } finally {
        clearTimeout(timeout);
      }
    }
  • Helper function that formats API response data into the MCP tool result format with JSON stringification.
    function jsonResult(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about cost ('Costs 1 credit'), which is a behavioral trait not covered elsewhere. However, it lacks details on rate limits, error handling, or response format, leaving gaps in transparency for a tool with no annotations.

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?

The description is extremely concise and front-loaded: 'Get autocomplete suggestions for a search query using SearchClaw. Costs 1 credit.' Every sentence earns its place by stating the purpose and a key behavioral trait (cost), with zero wasted words, making it highly efficient.

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 low complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers purpose and cost but lacks details on output format, error cases, or integration with siblings. Without annotations or output schema, more context would be helpful, making it adequate but not fully comprehensive.

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 parameter 'q' documented as 'Partial query for autocomplete suggestions.' The description doesn't add any additional meaning beyond this, such as examples or constraints. According to the rules, with high schema coverage (>80%), the baseline is 3, which is appropriate here.

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: 'Get autocomplete suggestions for a search query using SearchClaw.' It specifies the verb ('Get'), resource ('autocomplete suggestions'), and system ('SearchClaw'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like 'search' or 'search_ai', which prevents a perfect score.

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 implies usage context by mentioning 'Costs 1 credit,' which suggests a cost consideration, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search' or 'search_ai'. No when-not-to-use scenarios or prerequisites are mentioned, leaving usage somewhat ambiguous.

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/CSteenkamp/searchclaw-mcp'

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