Skip to main content
Glama
Mnehmos

arXiv MCP Server

search_papers

Search arXiv academic papers by query, category, author, title, or abstract with customizable sorting and pagination.

Instructions

Search for papers on arXiv by various criteria

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGeneral search query across all fields
categoryNoarXiv category (e.g., cs.AI, physics.optics)
authorNoAuthor name
titleNoWords in the title
abstractNoWords in the abstract
startNoStarting index for pagination (0-based)
max_resultsNoMaximum number of results to return (max 2000)
sort_byNoSort by: relevance, lastUpdatedDate, submittedDate
sort_orderNoSort order: ascending or descending

Implementation Reference

  • The primary handler function for the 'search_papers' tool. It constructs arXiv API search parameters from input arguments and delegates to the queryArxiv helper.
    public async searchPapers(args: SearchPapersArgs) {
      const searchParams: SearchParams = {};
      
      // Build search query
      const searchTerms: string[] = [];
      
      if (args.query) {
        searchTerms.push(`all:${args.query}`);
      }
      
      if (args.category) {
        searchTerms.push(`cat:${args.category}`);
      }
      
      if (args.author) {
        searchTerms.push(`au:${args.author}`);
      }
      
      if (args.title) {
        searchTerms.push(`ti:${args.title}`);
      }
      
      if (args.abstract) {
        searchTerms.push(`abs:${args.abstract}`);
      }
      
      if (searchTerms.length > 0) {
        searchParams.search_query = searchTerms.join('+AND+');
      }
      
      // Add pagination
      if (args.start !== undefined) {
        searchParams.start = args.start;
      }
      
      if (args.max_results !== undefined) {
        searchParams.max_results = Math.min(args.max_results, 2000); // API limit
      } else {
        searchParams.max_results = 10; // Default
      }
      
      // Add sorting
      if (args.sort_by) {
        searchParams.sortBy = args.sort_by;
      }
      
      if (args.sort_order) {
        searchParams.sortOrder = args.sort_order;
      }
      
      const response = await this.queryArxiv(searchParams);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • TypeScript interface defining the input parameters for the search_papers tool.
    interface SearchPapersArgs {
      query?: string;
      category?: string;
      author?: string;
      title?: string;
      abstract?: string;
      start?: number;
      max_results?: number;
      sort_by?: string;
      sort_order?: string;
    }
  • src/index.ts:108-154 (registration)
    Tool registration including name, description, and JSON input schema for 'search_papers'.
    {
      name: 'search_papers',
      description: 'Search for papers on arXiv by various criteria',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'General search query across all fields',
          },
          category: {
            type: 'string',
            description: 'arXiv category (e.g., cs.AI, physics.optics)',
          },
          author: {
            type: 'string',
            description: 'Author name',
          },
          title: {
            type: 'string',
            description: 'Words in the title',
          },
          abstract: {
            type: 'string',
            description: 'Words in the abstract',
          },
          start: {
            type: 'number',
            description: 'Starting index for pagination (0-based)',
          },
          max_results: {
            type: 'number',
            description: 'Maximum number of results to return (max 2000)',
          },
          sort_by: {
            type: 'string',
            description: 'Sort by: relevance, lastUpdatedDate, submittedDate',
            enum: ['relevance', 'lastUpdatedDate', 'submittedDate'],
          },
          sort_order: {
            type: 'string',
            description: 'Sort order: ascending or descending',
            enum: ['ascending', 'descending'],
          },
        },
      },
    },
  • src/index.ts:221-222 (registration)
    Dispatch handler in CallToolRequestSchema that routes 'search_papers' calls to the searchPapers method.
    case 'search_papers':
      return await this.searchPapers(request.params.arguments as unknown as SearchPapersArgs);
  • Helper method that performs the actual arXiv API query, called by the searchPapers handler.
    private async queryArxiv(params: SearchParams) {
      try {
        const response = await axios.get(ARXIV_API_BASE_URL, { params });
        
        // Parse the XML response
        const xmlData = response.data;
        
        // Extract and process the data
        // For simplicity, we're returning the raw XML data
        // In a production environment, you would parse this XML into a more usable format
        return this.processArxivResponse(xmlData);
      } catch (error) {
        console.error('Error querying arXiv API:', error);
        throw error;
      }
    }
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 it's a search operation, implying read-only behavior, but doesn't mention rate limits, authentication needs, pagination details beyond parameters, or what the output format looks like (e.g., list of papers with metadata). This leaves significant gaps for a tool with 9 parameters.

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 front-loads the core purpose ('Search for papers on arXiv') and adds a brief qualifier ('by various criteria'). There is no wasted verbiage or redundancy, making it highly concise and well-structured.

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 complexity (9 parameters, no output schema, no annotations), the description is insufficient. It doesn't explain the return values, behavioral constraints like rate limits, or how to interpret results. For a search tool with multiple siblings, more context is needed to guide effective use.

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?

Schema description coverage is 100%, so the schema fully documents all 9 parameters with descriptions and enums. The description adds no additional meaning beyond implying 'various criteria', which aligns with the schema but doesn't compensate for any gaps (none exist here). Baseline 3 is appropriate as 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 clearly states the action ('Search for papers') and resource ('on arXiv'), specifying the domain. It mentions 'by various criteria' which hints at flexibility, but doesn't explicitly differentiate from sibling tools like 'search_by_category', which might handle more specific filtering.

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?

No guidance is provided on when to use this tool versus alternatives like 'search_by_category' or 'get_paper'. The description lacks context on use cases, prerequisites, or exclusions, leaving the agent to infer usage based on parameter names 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/Mnehmos/mnehmos.arxiv.mcp'

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