Skip to main content
Glama
andybrandt

mcp-simple-arxiv

by andybrandt

update_categories

Fetch and update the latest category taxonomy from arxiv.org to ensure accurate categorization and organization of research papers in the MCP server.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'update_categories' tool using the @app.tool decorator in FastMCP, including annotations for title, readOnlyHint, and openWorldHint.
    @app.tool( annotations={ "title": "Update arXiv Categories", "readOnlyHint": False, "openWorldHint": True } )
  • The handler function for 'update_categories' tool. It calls the helper update_taxonomy_file() to refresh the taxonomy.json, then formats and returns a success message listing the 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
  • Core helper function that writes the built-in CATEGORIES dictionary to taxonomy.json file and returns it. This is invoked by the tool handler to 'update' the taxonomy.
    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
  • Function signature and docstring defining the tool's input (none) and output (str), serving as the schema.
    def update_categories() -> str: """Update the stored category taxonomy by fetching the latest version from arxiv.org"""

Other Tools

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

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