Skip to main content
Glama

get_arxiv_pdf_url

Extract direct PDF download links from arXiv paper URLs or IDs to access academic research documents.

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 takes an arXiv URL or ID and returns the corresponding PDF download URL.
    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)}`);
      }
    }
  • The input schema and metadata definition for the 'get_arxiv_pdf_url' tool, registered in the ListTools handler.
    {
      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)
    The registration block in the main CallToolRequestSchema handler that dispatches to the getArxivPdfUrl function and formats the response.
    case "get_arxiv_pdf_url": {
      const { input } = args as { input: string };
      const pdfUrl = getArxivPdfUrl(input);
    
      return {
        content: [{
          type: "text",
          text: `PDF 下载链接: ${pdfUrl}`
        }]
      };
    }
  • Usage of getArxivPdfUrl as a helper function within the parse_paper_content tool.
    const pdfUrl = getArxivPdfUrl(input);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't reveal any behavioral traits like whether it's read-only, requires authentication, has rate limits, or what the output format might be. This is a significant gap for a tool with no annotation coverage.

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 in Chinese ('获取 arXiv PDF 下载链接') that directly states the tool's purpose with zero waste. It's appropriately sized and front-loaded, 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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a PDF URL string), potential errors, or behavioral context, leaving gaps that could hinder an AI agent's ability to use the tool effectively.

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 input parameter clearly documented as accepting arXiv URLs or IDs. The description doesn't add any meaning beyond what the schema provides, such as examples or constraints, so it meets the baseline score of 3 where the schema does the heavy lifting.

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 verb ('获取' meaning 'get') and resource ('arXiv PDF 下载链接' meaning 'arXiv PDF download link'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_recent_ai_papers' or 'parse_paper_content' which also work with arXiv papers, so it doesn't reach the highest score.

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, such as needing an arXiv URL or ID, or exclusions, leaving the agent to infer usage from the input schema alone.

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/BACH-AI-Tools/bach-Arxiv-Paper-MCP'

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