Skip to main content
Glama
reetp14
by reetp14

get_entity

Retrieve detailed information about a specific scholarly entity from OpenAlex's research catalog using its unique identifier.

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 primary handler function implementing the logic for the 'get_entity' tool. It constructs an API request to OpenAlex for the specified entity type and ID, using optional select and mailto parameters, and returns the JSON 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 defining the parameters for the 'get_entity' tool, including required entity_type and openalex_id, and optional fields.
    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:204-222 (registration)
    Registration of the 'get_entity' tool in the ListToolsRequestHandler, providing name, description, and input schema.
    { 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)
    Tool dispatch logic in the CallToolRequestHandler switch statement, routing 'get_entity' calls to the getEntity handler function.
    case "get_entity": return await getEntity(args);
  • src/index.ts:29-29 (registration)
    Import statement bringing in the getEntity handler from its module.
    import { getEntity } from "./tools/getEntity.js";

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