Skip to main content
Glama
lithtrix

lithtrix-mcp

Official

lithtrix_blob_search

Search parsed chunks semantically using natural-language queries. Control result count and similarity threshold for precise retrieval.

Instructions

GET /v1/blobs/search — semantic search over parsed chunks; shares quota with web search. Requires LITHTRIX_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesNatural-language query
limitNoMax hits (1–20)
thresholdNoMinimum similarity (0–1)

Implementation Reference

  • Tool handler for lithtrix_blob_search: builds a GET /v1/blobs/search URL with query, optional limit, and optional threshold params; calls the Lithtrix API; returns JSON response.
    async ({ q, limit, threshold }) => {
      const apiKey = process.env.LITHTRIX_API_KEY;
      if (!apiKey) return missingApiKeyResponse();
    
      const url = new URL("/v1/blobs/search", LITHTRIX_API_URL);
      url.searchParams.set("q", q);
      if (limit !== undefined) url.searchParams.set("limit", String(limit));
      if (threshold !== undefined) url.searchParams.set("threshold", String(threshold));
    
      let response;
      try {
        response = await fetch(url.toString(), {
          headers: { Authorization: `Bearer ${apiKey}` },
        });
      } catch (err) {
        return networkErrorResponse(err);
      }
      return apiJsonResponse(response);
    }
  • Input schema for lithtrix_blob_search: requires 'q' (string 1-500 chars), optional 'limit' (int 1-20), optional 'threshold' (float 0-1).
    {
      q: z.string().min(1).max(500).describe("Natural-language query"),
      limit: z.number().int().min(1).max(20).optional().describe("Max hits (1–20)"),
      threshold: z
        .number()
        .min(0)
        .max(1)
        .optional()
        .describe("Minimum similarity (0–1)"),
  • tools/parse.js:150-182 (registration)
    Registration of lithtrix_blob_search via server.tool() with name, description, input schema, and handler.
    server.tool(
      "lithtrix_blob_search",
      "GET /v1/blobs/search — semantic search over parsed chunks; shares quota with web search. Requires LITHTRIX_API_KEY.",
      {
        q: z.string().min(1).max(500).describe("Natural-language query"),
        limit: z.number().int().min(1).max(20).optional().describe("Max hits (1–20)"),
        threshold: z
          .number()
          .min(0)
          .max(1)
          .optional()
          .describe("Minimum similarity (0–1)"),
      },
      async ({ q, limit, threshold }) => {
        const apiKey = process.env.LITHTRIX_API_KEY;
        if (!apiKey) return missingApiKeyResponse();
    
        const url = new URL("/v1/blobs/search", LITHTRIX_API_URL);
        url.searchParams.set("q", q);
        if (limit !== undefined) url.searchParams.set("limit", String(limit));
        if (threshold !== undefined) url.searchParams.set("threshold", String(threshold));
    
        let response;
        try {
          response = await fetch(url.toString(), {
            headers: { Authorization: `Bearer ${apiKey}` },
          });
        } catch (err) {
          return networkErrorResponse(err);
        }
        return apiJsonResponse(response);
      }
    );
  • Helper to return a missing API key error response.
    function missingApiKeyResponse() {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              error:
                "LITHTRIX_API_KEY environment variable is not set. " +
                "Register at https://lithtrix.ai and use lithtrix_register, then set the key.",
            }),
          },
        ],
        isError: true,
      };
  • Helper to parse API response JSON and return success/error MCP content.
    async function apiJsonResponse(response) {
      let body;
      try {
        body = await response.json();
      } catch {
        body = { message: `Invalid JSON (HTTP ${response.status})` };
      }
    
      if (!response.ok) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                error: body.message ?? `Lithtrix API error (HTTP ${response.status})`,
                error_code: body.error_code ?? "UNKNOWN",
                status: body.status,
              }),
            },
          ],
          isError: true,
        };
      }
    
      return {
        content: [{ type: "text", text: JSON.stringify(body, null, 2) }],
      };
    }
Behavior3/5

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

The description discloses the API key requirement and quota sharing, which are important behavioral traits not covered by annotations (none exist). However, it omits details about response format, error handling, and idempotency, leaving gaps for a tool with no annotation safety net.

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 two sentences long, front-loaded with the endpoint and core purpose, and every sentence adds value (endpoint, purpose, quota sharing, auth requirement). No excess wording.

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?

The description covers endpoint, purpose, auth, and quota context. However, given no output schema, it would benefit from briefly indicating the return structure (e.g., 'returns matching chunks with scores'). As is, it is slightly incomplete.

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 already provides complete descriptions for all three parameters (q, limit, threshold) with 100% coverage. The description adds no additional parameter semantics beyond what is in the schema.

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?

The description clearly states it performs 'semantic search over parsed chunks' and distinguishes from siblings by mentioning it 'shares quota with web search'. The verb and resource are specific and unambiguous.

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?

The description provides context (searches blob chunks, shares quota with web search) that implies when to use this tool versus the web-based lithtrix_search, but does not explicitly state when not to use it or name alternatives.

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/lithtrix/lithtrix-mcp'

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