Skip to main content
Glama

document-download

Retrieve documents from storage by specifying their path. Returns file content or a download URL for access.

Instructions

Download a document by its storage path. Returns the file content or a download URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDocument storage path

Implementation Reference

  • The handler function that executes the document download tool.
    async (params) => {
      try {
        const response = await client.documents.download(params.path);
        const text = await response.text();
        return { content: [{ type: "text", text }] };
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
      }
    },
  • Tool registration for 'document-download' within the MCP server.
    server.tool(
      "document-download",
      "Download a document by its storage path. Returns the file content or a download URL.",
      {
        path: z.string().describe("Document storage path"),
      },
      async (params) => {
        try {
          const response = await client.documents.download(params.path);
          const text = await response.text();
          return { content: [{ type: "text", text }] };
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
        }
      },
    );

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/ebenezer-isaac/llmconveyors-mcp'

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