Skip to main content
Glama
reetp14

OpenAlex MCP Server

by reetp14

autocomplete

Find scholarly entities in OpenAlex by typing search terms, with suggestions for works, authors, institutions, and other research data types.

Instructions

Type ahead search across any OpenAlex entity type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesSearch query for autocomplete
typeNoEntity type to search within
per_pageNoNumber of suggestions (max 50)
mailtoNoEmail for rate limits
api_keyNoPremium API key

Implementation Reference

  • The core handler function for the 'autocomplete' tool. It calls the OpenAlex /autocomplete endpoint using makeOpenAlexRequest utility and returns the JSON response formatted as MCP text content.
    export async function autocomplete(args: any) {
        return {
            content: [{
                    type: "text",
                    text: JSON.stringify(await makeOpenAlexRequest("/autocomplete", args), null, 2)
                }]
        };
    }
  • Input schema for the autocomplete tool, defining the expected arguments including the required 'search' query and optional parameters.
    inputSchema: {
        type: "object",
        properties: {
            search: { type: "string", description: "Search query for autocomplete", required: true },
            type: {
                type: "string",
                enum: ["works", "authors", "sources", "institutions", "concepts", "publishers", "funders"],
                description: "Entity type to search within"
            },
            per_page: { type: "number", description: "Number of suggestions (max 50)" },
            mailto: { type: "string", description: "Email for rate limits" },
            api_key: { type: "string", description: "Premium API key" }
        },
        required: ["search"]
    }
  • src/index.ts:223-241 (registration)
    Registration of the 'autocomplete' tool in the MCP listTools handler, providing name, description, and input schema.
    {
        name: "autocomplete",
        description: "Type ahead search across any OpenAlex entity type",
        inputSchema: {
            type: "object",
            properties: {
                search: { type: "string", description: "Search query for autocomplete", required: true },
                type: {
                    type: "string",
                    enum: ["works", "authors", "sources", "institutions", "concepts", "publishers", "funders"],
                    description: "Entity type to search within"
                },
                per_page: { type: "number", description: "Number of suggestions (max 50)" },
                mailto: { type: "string", description: "Email for rate limits" },
                api_key: { type: "string", description: "Premium API key" }
            },
            required: ["search"]
        }
    },
  • src/index.ts:297-298 (registration)
    Dispatch/registration in the main CallToolRequest switch statement that routes to the autocomplete handler.
    case "autocomplete":
        return await autocomplete(args);
  • TypeScript interface defining the structure of autocomplete results from OpenAlex API.
    export interface AutocompleteResult {
      id: string;
      display_name: string;
      hint?: string;
      cited_by_count?: number;
      works_count?: number;
      entity_type: string;
      external_id?: string;
    }
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 but offers minimal information. It mentions 'type ahead search' which implies real-time suggestions, but doesn't describe response format, rate limits (beyond the mailto parameter hint), error conditions, or performance characteristics. For a tool with 5 parameters and no output schema, 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 extremely concise at just 7 words, front-loading the core functionality with zero wasted language. Every word earns its place: 'Type ahead' establishes the interaction pattern, 'search' specifies the action, 'across any OpenAlex entity type' defines the scope. This is a model of efficiency in technical documentation.

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 tool's complexity (5 parameters, no annotations, no output schema, multiple sibling alternatives), the description is insufficiently complete. While concise, it doesn't address key contextual questions: how results differ from full search tools, what the output format looks like, authentication requirements, or rate limiting behavior. The agent would need to guess or trial-error these aspects.

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 description doesn't explicitly mention any parameters, though 'type ahead search' implies the 'search' parameter. With 100% schema description coverage, all parameters are well-documented in the schema itself, so the description doesn't need to compensate. The baseline score of 3 reflects adequate parameter documentation through the schema alone, though the description adds no additional semantic context.

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 tool's purpose: 'Type ahead search across any OpenAlex entity type'. It specifies the verb ('search') and resource ('OpenAlex entity type'), making the function immediately understandable. However, it doesn't explicitly distinguish this autocomplete functionality from the various search_* sibling tools, which likely offer more comprehensive search capabilities.

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. With multiple search-related sibling tools (search_authors, search_works, etc.), there's no indication whether this is for quick suggestions versus full results, or what distinguishes it from get_entity for lookup operations. The agent must infer usage context from the name and description 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/reetp14/openalex-mcp'

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