Skip to main content
Glama
lithtrix

lithtrix-mcp

Official

lithtrix_blob_signed_url

Generate a time-limited HTTPS read URL for a blob. Anyone with the URL can access the data until the expiry time.

Instructions

Mint a time-limited HTTPS read URL for a blob (GET /v1/blobs/{blob_id}/signed-url). Anyone with the URL can GET bytes until expiry — share carefully. Requires LITHTRIX_API_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blob_idYesContent-addressed blob id (b_ + 16 hex chars)
expires_inNoTTL seconds (min 60; max from server). Omit for API default.

Implementation Reference

  • The tool handler for 'lithtrix_blob_signed_url'. It mints a time-limited HTTPS read URL by calling GET /v1/blobs/{blob_id}/signed-url. Requires LITHTRIX_API_KEY. Accepts optional expires_in parameter (min 60 seconds). Returns the API JSON response containing the signed URL.
    server.tool(
      "lithtrix_blob_signed_url",
      "Mint a time-limited HTTPS read URL for a blob (GET /v1/blobs/{blob_id}/signed-url). " +
        "Anyone with the URL can GET bytes until expiry — share carefully. Requires LITHTRIX_API_KEY.",
      {
        blob_id: blobIdSchema,
        expires_in: z
          .number()
          .int()
          .min(60)
          .optional()
          .describe("TTL seconds (min 60; max from server). Omit for API default."),
      },
      async ({ blob_id, expires_in }) => {
        const apiKey = process.env.LITHTRIX_API_KEY;
        if (!apiKey) return missingApiKeyResponse();
    
        const url = new URL(
          `/v1/blobs/${encodeURIComponent(blob_id)}/signed-url`,
          LITHTRIX_API_URL
        );
        if (expires_in !== undefined) {
          url.searchParams.set("expires_in", String(expires_in));
        }
    
        let response;
        try {
          response = await fetch(url.toString(), {
            headers: { Authorization: `Bearer ${apiKey}` },
          });
        } catch (err) {
          return networkErrorResponse(err);
        }
        return apiJsonResponse(response);
      }
    );
  • Input schema for the tool: blob_id (string, 19 chars, pattern b_ + 16 hex chars) and optional expires_in (integer, min 60).
    {
      blob_id: blobIdSchema,
      expires_in: z
        .number()
        .int()
        .min(60)
        .optional()
        .describe("TTL seconds (min 60; max from server). Omit for API default."),
    },
  • tools/blobs.js:295-331 (registration)
    The tool is registered via server.tool('lithtrix_blob_signed_url', ...) inside the exported registerBlobTools function.
      server.tool(
        "lithtrix_blob_signed_url",
        "Mint a time-limited HTTPS read URL for a blob (GET /v1/blobs/{blob_id}/signed-url). " +
          "Anyone with the URL can GET bytes until expiry — share carefully. Requires LITHTRIX_API_KEY.",
        {
          blob_id: blobIdSchema,
          expires_in: z
            .number()
            .int()
            .min(60)
            .optional()
            .describe("TTL seconds (min 60; max from server). Omit for API default."),
        },
        async ({ blob_id, expires_in }) => {
          const apiKey = process.env.LITHTRIX_API_KEY;
          if (!apiKey) return missingApiKeyResponse();
    
          const url = new URL(
            `/v1/blobs/${encodeURIComponent(blob_id)}/signed-url`,
            LITHTRIX_API_URL
          );
          if (expires_in !== undefined) {
            url.searchParams.set("expires_in", String(expires_in));
          }
    
          let response;
          try {
            response = await fetch(url.toString(), {
              headers: { Authorization: `Bearer ${apiKey}` },
            });
          } catch (err) {
            return networkErrorResponse(err);
          }
          return apiJsonResponse(response);
        }
      );
    }
  • index.js:48-48 (registration)
    registerBlobTools(server) is called from index.js, which registers the tool on the MCP server.
    registerBlobTools(server);
  • Helper function apiJsonResponse that formats the API response into MCP text content. Used by the signed_url handler to return results.
    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?

With no annotations, the description carries full burden. It discloses time-limited access and authentication requirement (LITHTRIX_API_KEY), but omits details like whether the URL is revocable, whether it counts towards rate limits, or if it leaves any trace.

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, front-loaded with the core action, no redundant words. Every sentence adds value.

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 description does not mention the return value (a signed URL string). For a tool that outputs a URL, this is a significant gap. It also lacks guidance on error cases or URL format.

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

Parameters4/5

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

Schema has 100% coverage with clear parameter descriptions. Description adds context like 'time-limited' and 'Omit for API default' for expires_in, enhancing understanding beyond 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?

Description uses specific verb 'Mint' and identifies the resource 'time-limited HTTPS read URL for a blob'. It includes the HTTP method and endpoint, clearly differentiating from siblings like lithtrix_blob_download and lithtrix_blob_meta.

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 states that anyone with the URL can GET bytes until expiry and advises caution, implying the tool is for temporary sharing. However, it does not explicitly say when not to use it or name alternative tools.

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