Skip to main content
Glama

download_paper

Download cryptographic research papers from the IACR Cryptology ePrint Archive in PDF or TXT formats by specifying the paper ID and desired format.

Instructions

Download a paper in PDF or TXT format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNopdf
paper_idYes

Implementation Reference

  • The main handler function for the 'download_paper' tool. It validates input using DownloadPaperSchema, fetches the paper from eprint.iacr.org in the specified format (pdf or txt), encodes it as base64, and returns it as a file artifact.
    private async downloadPaper(args: unknown) {
      const validatedArgs = DownloadPaperSchema.parse(args);
      
      try {
        const response = await axios.get(`https://eprint.iacr.org/${validatedArgs.paper_id}.${validatedArgs.format}`, {
          responseType: 'arraybuffer'
        });
    
        return {
          content: [{
            type: 'file',
            name: `${validatedArgs.paper_id}.${validatedArgs.format}`,
            data: response.data.toString('base64')
          }]
        };
      } catch (error) {
        console.error('Paper Download Error:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `Paper download failed: ${error instanceof Error ? error.message : 'Unknown error'}`
        );
      }
    }
  • Zod schema defining the input parameters for the download_paper tool: paper_id (required string), format (optional enum ['pdf', 'txt'] defaulting to 'pdf'). Used for validation in the handler.
    const DownloadPaperSchema = z.object({
      paper_id: z.string(),
      format: z.enum(['pdf', 'txt']).optional().default('pdf')
    });
  • src/index.ts:92-107 (registration)
    Tool registration in the ListTools response, providing the name 'download_paper', description, and inputSchema matching the Zod schema.
    {
      name: 'download_paper',
      description: 'Download a paper in PDF or TXT format',
      inputSchema: {
        type: 'object',
        properties: {
          paper_id: { type: 'string' },
          format: { 
            type: 'string', 
            enum: ['pdf', 'txt'], 
            default: 'pdf' 
          }
        },
        required: ['paper_id']
      }
    }
  • src/index.ts:118-119 (registration)
    Dispatch logic in the CallTool request handler switch statement that routes 'download_paper' calls to the downloadPaper method.
    case 'download_paper':
      return this.downloadPaper(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool downloads a paper, implying it retrieves data, but doesn't cover critical aspects like whether it's a read-only operation, if it requires authentication, rate limits, error handling, or what the output looks like (e.g., file content or download link). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that directly states the tool's function and available formats. It's front-loaded with the core action and avoids unnecessary details, making it easy to parse quickly. Every word contributes to understanding the tool's purpose.

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?

Given the tool's moderate complexity (2 parameters, no annotations, no output schema), the description is incomplete. It covers the basic action and format options but lacks details on parameter usage, behavioral traits, output expectations, and differentiation from siblings. Without annotations or output schema, more context is needed for effective use by an AI agent.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'PDF or TXT format', which aligns with the 'format' parameter's enum, adding some meaning. However, it doesn't explain the 'paper_id' parameter at all, leaving its purpose and format unclear. With 2 parameters and low coverage, the description adds limited value beyond the schema.

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 action ('Download') and resource ('a paper'), specifying the available formats ('PDF or TXT format'). It distinguishes from sibling tools like 'get_paper_details' (which likely provides metadata) and 'search_papers' (which searches for papers), but doesn't explicitly differentiate them. The purpose is specific and actionable, though not fully contrasted with alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_paper_details' or 'search_papers'. It doesn't mention prerequisites, such as needing a valid 'paper_id', or contextual factors like availability of formats. Usage is implied by the action, but no explicit when/when-not instructions are given.

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

Related 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/doomdagadiggiedahdah/iacr-mcp-server'

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