Skip to main content
Glama
andybrandt

mcp-simple-arxiv

by andybrandt

update_categories

Fetch and update the arXiv paper category taxonomy to ensure accurate classification of research documents.

Instructions

Update the stored category taxonomy by fetching the latest version from arxiv.org

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the update_categories tool, which invokes the helper to update the taxonomy file and returns a formatted success message listing primary categories.
    def update_categories() -> str: """Update the stored category taxonomy by fetching the latest version from arxiv.org""" try: taxonomy = update_taxonomy_file() result = "Successfully updated category taxonomy.\n\n" result += f"Found {len(taxonomy)} primary categories:\n" for primary, data in taxonomy.items(): result += f"- {primary}: {data['name']} ({len(data['subcategories'])} subcategories)\n" return result except Exception as e: logger.error(f"Error updating taxonomy: {e}") # FastMCP will handle raising this as a proper JSON-RPC error raise e
  • Registers the 'update_categories' tool in the FastMCP app with metadata annotations including title and operational hints.
    @app.tool( annotations={ "title": "Update arXiv Categories", "readOnlyHint": False, "openWorldHint": True } )
  • Supporting function that generates and persists the arXiv category taxonomy to a JSON file from built-in data, used by the tool handler.
    def update_taxonomy_file(): """ Create taxonomy.json from the built-in categories. Returns the taxonomy dictionary. """ print(f"Creating taxonomy file at {TAXONOMY_FILE}...") with open(TAXONOMY_FILE, 'w', encoding='utf-8') as f: json.dump(CATEGORIES, f, indent=2, ensure_ascii=False) print("Done!") return CATEGORIES

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/andybrandt/mcp-simple-arxiv'

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