Skip to main content
Glama
yzfly

ArXiv Paper MCP

by yzfly

get_arxiv_pdf_url

Extract direct PDF download links from arXiv paper URLs or IDs to access research papers for reading or citation.

Instructions

获取 arXiv PDF 下载链接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesarXiv 论文URL(如:http://arxiv.org/abs/2403.15137v1)或 arXiv ID(如:2403.15137v1)

Implementation Reference

  • The core handler function that generates the arXiv PDF URL from either a full arXiv URL (by replacing '/abs/' with '/pdf/') or directly from the arXiv ID.
    function getArxivPdfUrl(input: string): string {
      try {
        let arxivId: string;
        let pdfUrl: string;
    
        if (input.startsWith('http://') || input.startsWith('https://')) {
          const urlParts = input.split('/');
          arxivId = urlParts[urlParts.length - 1];
          pdfUrl = input.replace('/abs/', '/pdf/') + '.pdf';
        } else {
          arxivId = input;
          pdfUrl = `http://arxiv.org/pdf/${arxivId}.pdf`;
        }
    
        return pdfUrl;
      } catch (error) {
        console.error("获取 PDF 链接时出错:", error);
        throw new Error(`获取PDF链接失败: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Input schema definition specifying the required 'input' parameter as a string (arXiv URL or ID).
    inputSchema: {
      type: "object",
      properties: {
        input: {
          type: "string",
          description: "arXiv 论文URL(如:http://arxiv.org/abs/2403.15137v1)或 arXiv ID(如:2403.15137v1)"
        }
      },
      required: ["input"]
    }
  • src/index.ts:353-365 (registration)
    Tool metadata registration in ListToolsRequestHandler, including name, description, and input schema.
      name: "get_arxiv_pdf_url",
      description: "获取 arXiv PDF 下载链接",
      inputSchema: {
        type: "object",
        properties: {
          input: {
            type: "string",
            description: "arXiv 论文URL(如:http://arxiv.org/abs/2403.15137v1)或 arXiv ID(如:2403.15137v1)"
          }
        },
        required: ["input"]
      }
    },
  • src/index.ts:425-435 (registration)
    Tool dispatch registration in CallToolRequestHandler: extracts input, calls the handler function, and returns the PDF URL in the response format.
    case "get_arxiv_pdf_url": {
      const { input } = args as { input: string };
      const pdfUrl = getArxivPdfUrl(input);
    
      return {
        content: [{
          type: "text",
          text: `PDF 下载链接: ${pdfUrl}`
        }]
      };
    }
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 what the tool does (gets a PDF URL) but lacks critical behavioral details: whether it's a read-only operation, error handling (e.g., for invalid IDs), rate limits, authentication needs, or what the output looks like (e.g., a direct URL string). For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Chinese that directly states the purpose without fluff. It's appropriately sized for a simple tool, though it could be slightly more structured (e.g., by including a brief example). There's no wasted verbiage, making it easy to parse quickly.

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 simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It lacks output details (what the PDF URL looks like), error conditions, and behavioral context. While the purpose is clear, the description doesn't provide enough information for an agent to use the tool confidently without trial and error, especially with no annotations to fill gaps.

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 schema description coverage is 100%, with the parameter 'input' fully documented in the schema as accepting arXiv URLs or IDs. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 '获取 arXiv PDF 下载链接' clearly states the action (获取/get) and resource (arXiv PDF 下载链接/arXiv PDF download URL), making the purpose immediately understandable. It distinguishes from siblings like 'get_recent_ai_papers' (list papers) and 'parse_paper_content' (extract content), but doesn't explicitly differentiate from 'search_arxiv' which might also return PDF URLs. The purpose is specific but could be slightly more precise about being a URL resolver rather than a downloader.

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 'search_arxiv' or 'parse_paper_content'. It doesn't mention prerequisites (e.g., needing an arXiv ID), exclusions, or typical use cases. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection in a multi-tool environment.

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/yzfly/Arxiv-Paper-MCP'

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