Skip to main content
Glama
lithtrix

lithtrix-mcp

Official

lithtrix_blob_parse

Extract text and tables from a blob using its unique identifier. Supports synchronous parsing or asynchronous processing with a callback URL for completion.

Instructions

POST /v1/blobs/{blob_id}/parse — extract text/tables; set async=true for QStash. Optional callback_url in JSON body. Requires LITHTRIX_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blob_idYesContent-addressed blob id (b_ + 16 hex chars)
asyncNoWhen true, calls ?async=true (async parse + poll)
callback_urlNoHTTPS callback for async completion (public host)

Implementation Reference

  • tools/parse.js:80-124 (registration)
    Registration of the 'lithtrix_blob_parse' tool via server.tool() on the MCP server. It defines the tool name, description, input schema (blob_id, async, callback_url), and the handler function.
    server.tool(
      "lithtrix_blob_parse",
      "POST /v1/blobs/{blob_id}/parse — extract text/tables; set async=true for QStash. Optional callback_url in JSON body. Requires LITHTRIX_API_KEY.",
      {
        blob_id: blobIdSchema,
        async: z
          .boolean()
          .optional()
          .describe("When true, calls ?async=true (async parse + poll)"),
        callback_url: z
          .string()
          .url()
          .max(2048)
          .optional()
          .describe("HTTPS callback for async completion (public host)"),
      },
      async ({ blob_id, async: asyncFlag, callback_url }) => {
        const apiKey = process.env.LITHTRIX_API_KEY;
        if (!apiKey) return missingApiKeyResponse();
    
        const url = new URL(
          `/v1/blobs/${encodeURIComponent(blob_id)}/parse`,
          LITHTRIX_API_URL
        );
        if (asyncFlag) url.searchParams.set("async", "true");
    
        const body =
          callback_url !== undefined ? JSON.stringify({ callback_url }) : undefined;
    
        let response;
        try {
          response = await fetch(url.toString(), {
            method: "POST",
            headers: {
              Authorization: `Bearer ${apiKey}`,
              ...(body ? { "Content-Type": "application/json" } : {}),
            },
            body,
          });
        } catch (err) {
          return networkErrorResponse(err);
        }
        return apiJsonResponse(response);
      }
    );
  • Input schema for lithtrix_blob_parse using Zod: blob_id (19-char hex string starting with b_), optional async boolean, and optional callback_url.
    {
      blob_id: blobIdSchema,
      async: z
        .boolean()
        .optional()
        .describe("When true, calls ?async=true (async parse + poll)"),
      callback_url: z
        .string()
        .url()
        .max(2048)
        .optional()
        .describe("HTTPS callback for async completion (public host)"),
    },
  • Handler function that makes a POST request to /v1/blobs/{blob_id}/parse with optional async flag and callback_url body. Requires LITHTRIX_API_KEY env var.
    async ({ blob_id, async: asyncFlag, callback_url }) => {
      const apiKey = process.env.LITHTRIX_API_KEY;
      if (!apiKey) return missingApiKeyResponse();
    
      const url = new URL(
        `/v1/blobs/${encodeURIComponent(blob_id)}/parse`,
        LITHTRIX_API_URL
      );
      if (asyncFlag) url.searchParams.set("async", "true");
    
      const body =
        callback_url !== undefined ? JSON.stringify({ callback_url }) : undefined;
    
      let response;
      try {
        response = await fetch(url.toString(), {
          method: "POST",
          headers: {
            Authorization: `Bearer ${apiKey}`,
            ...(body ? { "Content-Type": "application/json" } : {}),
          },
          body,
        });
      } catch (err) {
        return networkErrorResponse(err);
      }
      return apiJsonResponse(response);
    }
  • Helper function missingApiKeyResponse() used when LITHTRIX_API_KEY is not set.
    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 function networkErrorResponse(err) used when the fetch call fails.
    function networkErrorResponse(err) {
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              error: `Network error contacting Lithtrix API: ${err.message}`,
            }),
          },
        ],
        isError: true,
      };
    }
Behavior2/5

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

No annotations provided, so description carries full burden. It mentions the endpoint, authentication requirement, and async option but lacks details on side effects (e.g., whether parsing modifies state), rate limits, error handling, or response format. The description is too minimal for a zero-annotation scenario.

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?

Single sentence efficiently packs endpoint, purpose, async usage, callback note, and auth requirement. No redundant words, front-loaded with the essential action.

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

Completeness2/5

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

No output schema and no description of return format or behavior. The tool likely returns parsed data or a reference for polling, but the description does not explain the workflow. Given the existence of lithtrix_blob_parse_status, the description should clarify the relationship, which it does not.

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 coverage is 100% with detailed parameter descriptions. The tool description adds that async=true is for QStash, which slightly supplements the schema's 'async parse + poll'. However, for callback_url, the description just repeats the schema info. Baseline 3 is appropriate.

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 clearly states the tool extracts text/tables from a blob, with options for async parsing via QStash and callback. It distinguishes from sibling tools like lithtrix_blob_parse_status and lithtrix_blob_download.

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?

Description gives clear context: async=true for QStash, optional callback. However, it does not explicitly state when to use this tool instead of alternatives like lithtrix_blob_search or lithtrix_blob_parse_status, though the purpose is clear enough.

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