Skip to main content
Glama
Mnehmos

arXiv MCP Server

search_by_category

Find academic papers in specific arXiv categories by filtering search results with category codes, sorting options, and pagination controls.

Instructions

Search for papers in a specific arXiv category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesarXiv category (e.g., cs.AI, physics.optics)
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 handler function that implements the search_by_category tool logic. It constructs arXiv API search parameters using the provided category and optional pagination/sorting options, queries the arXiv API, and returns the processed response.
    private async searchByCategory(args: SearchByCategoryArgs) {
      const searchParams: SearchParams = {
        search_query: `cat:${args.category}`,
      };
      
      // 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),
          },
        ],
      };
    }
  • src/index.ts:169-200 (registration)
    Tool registration in the ListTools response, including name, description, and input schema definition.
    {
      name: 'search_by_category',
      description: 'Search for papers in a specific arXiv category',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'arXiv category (e.g., cs.AI, physics.optics)',
          },
          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'],
          },
        },
        required: ['category'],
      },
    },
  • TypeScript interface defining the input parameters for the searchByCategory handler.
    interface SearchByCategoryArgs {
      category: string;
      start?: number;
      max_results?: number;
      sort_by?: string;
      sort_order?: string;
    }
  • src/index.ts:231-238 (registration)
    Dispatch logic in CallToolRequest handler that validates input and routes to the searchByCategory method.
    case 'search_by_category':
      if (!request.params.arguments || typeof request.params.arguments.category !== 'string') {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Missing or invalid category parameter'
        );
      }
      return await this.searchByCategory(request.params.arguments as unknown as SearchByCategoryArgs);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions searching papers by category but doesn't describe what the search returns (metadata, abstracts, full content?), pagination behavior beyond the parameters, rate limits, authentication needs, or error conditions. For a search tool with 5 parameters, this leaves significant behavioral gaps.

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 gets straight to the point with zero wasted words. It's appropriately sized for a search tool and front-loads the core functionality without unnecessary preamble.

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?

For a search tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what results look like (paper metadata, abstracts, IDs?), how results are structured, or provide context about the arXiv category system. The agent would need to infer or guess about the output format and behavioral characteristics.

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 already documents all 5 parameters thoroughly with descriptions and enums. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain category format examples beyond what's in the schema, or provide context about typical usage patterns for the parameters.

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 verb ('Search for') and resource ('papers'), and specifies the scope ('in a specific arXiv category'). However, it doesn't explicitly differentiate from sibling tools like 'search_papers' - both appear to search papers, so the distinction isn't articulated.

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_papers' or 'get_paper'. It mentions the category constraint but doesn't explain if this is the only way to search by category or when other search approaches might be more appropriate.

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