Skip to main content
Glama
reetp14

OpenAlex MCP Server

by reetp14

get_entity

Retrieve detailed information about a specific scholarly entity from OpenAlex using its unique ID, supporting works, authors, institutions, sources, topics, publishers, and funders.

Instructions

Get a single entity by its OpenAlex ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_typeYesType of entity to retrieve
openalex_idYesOpenAlex ID (e.g., W2741809807, A1969205038)
selectNoComma-separated list of fields to return
mailtoNoEmail for rate limits
api_keyNoPremium API key

Implementation Reference

  • The main handler function for the 'get_entity' tool. It extracts parameters from args, constructs query params, calls makeOpenAlexRequest to fetch the entity data from OpenAlex API, and returns the JSON stringified response as text content.
    export async function getEntity(args: any) {
        const { entity_type, openalex_id, select, mailto } = args;
        const params: Record<string, any> = {};
        if (select)
            params.select = select;
        if (mailto)
            params.mailto = mailto;
        return {
            content: [{
                    type: "text",
                    text: JSON.stringify(await makeOpenAlexRequest(`/${entity_type}/${openalex_id}`, params), null, 2)
                }]
        };
    }
  • The input schema definition for the 'get_entity' tool provided in the ListTools response, specifying required and optional parameters with types and descriptions.
    {
        name: "get_entity",
        description: "Get a single entity by its OpenAlex ID",
        inputSchema: {
            type: "object",
            properties: {
                entity_type: {
                    type: "string",
                    enum: ["works", "authors", "sources", "institutions", "topics", "publishers", "funders"],
                    description: "Type of entity to retrieve"
                },
                openalex_id: { type: "string", description: "OpenAlex ID (e.g., W2741809807, A1969205038)" },
                select: { type: "string", description: "Comma-separated list of fields to return" },
                mailto: { type: "string", description: "Email for rate limits" },
                api_key: { type: "string", description: "Premium API key" }
            },
            required: ["entity_type", "openalex_id"]
        }
    },
  • src/index.ts:295-296 (registration)
    The switch case in the CallToolRequest handler that registers and dispatches calls to the 'get_entity' tool by invoking the getEntity function.
    case "get_entity":
        return await getEntity(args);
  • src/index.ts:29-29 (registration)
    Import statement that brings the getEntity handler into the main index file for use in tool dispatching.
    import { getEntity } from "./tools/getEntity.js";
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 states this is a 'Get' operation but doesn't mention whether it's read-only, what happens with invalid IDs, rate limiting implications, authentication requirements, or response format. The description lacks crucial behavioral context for API interaction.

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 directly states the tool's purpose. It's front-loaded with the core functionality and contains no unnecessary words or redundant information. Every word earns its place in conveying the essential operation.

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 tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't address authentication needs (api_key), rate limiting (mailto), field selection (select), or what constitutes a valid OpenAlex ID format. The description leaves too many operational questions unanswered given the tool's complexity.

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. The description adds no parameter-specific information beyond what's in the schema. It mentions 'OpenAlex ID' which aligns with the openalex_id parameter but provides no additional semantic context. Baseline 3 is appropriate when 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 verb ('Get') and resource ('a single entity'), specifying retrieval by OpenAlex ID. It distinguishes from sibling search tools by focusing on single entity lookup rather than searching. However, it doesn't explicitly differentiate from other potential get_* tools that might exist.

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. It doesn't mention when to use get_entity versus the various search_* sibling tools, nor does it indicate prerequisites like needing an OpenAlex ID. The description assumes the user already knows they need to retrieve a specific entity by ID.

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