Skip to main content
Glama
reetp14

OpenAlex MCP Server

by reetp14

classify_text

Predict research concepts and confidence scores from text titles or abstracts using OpenAlex's scholarly classification system.

Instructions

Classify arbitrary text to predict research concepts and confidence scores

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoTitle text to classify
abstractNoAbstract text to classify
mailtoNoEmail for rate limits
api_keyNoPremium API key

Implementation Reference

  • The classifyText function implements the core logic of the 'classify_text' tool. It extracts title, abstract, and mailto from args, constructs params, calls makeOpenAlexRequest to the /text endpoint, and returns the JSON response formatted as MCP content.
    export async function classifyText(args: any) {
        const { title, abstract, mailto } = args;
        const params: Record<string, any> = {};
        if (title)
            params.title = title;
        if (abstract)
            params.abstract = abstract;
        if (mailto)
            params.mailto = mailto;
        return {
            content: [{
                    type: "text",
                    text: JSON.stringify(await makeOpenAlexRequest("/text", params), null, 2)
                }]
        };
    }
  • Input schema for the classify_text tool, defining optional parameters: title, abstract, mailto, and api_key.
    inputSchema: {
        type: "object",
        properties: {
            title: { type: "string", description: "Title text to classify" },
            abstract: { type: "string", description: "Abstract text to classify" },
            mailto: { type: "string", description: "Email for rate limits" },
            api_key: { type: "string", description: "Premium API key" }
        }
    }
  • src/index.ts:242-254 (registration)
    Registration of the classify_text tool in the ListToolsRequestHandler response, providing name, description, and input schema.
    {
        name: "classify_text",
        description: "Classify arbitrary text to predict research concepts and confidence scores",
        inputSchema: {
            type: "object",
            properties: {
                title: { type: "string", description: "Title text to classify" },
                abstract: { type: "string", description: "Abstract text to classify" },
                mailto: { type: "string", description: "Email for rate limits" },
                api_key: { type: "string", description: "Premium API key" }
            }
        }
    },
  • src/index.ts:299-300 (registration)
    Dispatch registration in the CallToolRequestHandler switch statement, mapping 'classify_text' to the classifyText handler function.
    case "classify_text":
        return await classifyText(args);
  • src/index.ts:31-31 (registration)
    Import statement that brings the classifyText handler into the main index.ts for use in tool dispatch.
    import { classifyText } from "./tools/classifyText.js";
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. It mentions 'predict research concepts and confidence scores,' which implies a read-only analysis operation, but fails to disclose critical traits like authentication needs (e.g., 'api_key' usage), rate limits (implied by 'mailto'), or potential costs. This leaves significant gaps in understanding the tool's behavior and constraints.

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: 'Classify arbitrary text to predict research concepts and confidence scores.' It is front-loaded with the core purpose, uses clear language, and avoids unnecessary words. Every part of the sentence contributes directly to explaining the tool's function, making it highly concise and well-structured.

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 complexity of a classification tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format (e.g., structure of 'research concepts and confidence scores'), error handling, or how parameters like 'api_key' affect functionality. This leaves the agent with inadequate context for effective tool invocation and result interpretation.

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 input schema has 100% description coverage, so parameters like 'title,' 'abstract,' 'mailto,' and 'api_key' are documented in the schema. The description adds no additional semantic details about these parameters, such as how 'title' and 'abstract' interact or why 'mailto' is needed for rate limits. This meets the baseline for high schema coverage but doesn't enhance understanding beyond the schema.

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: 'Classify arbitrary text to predict research concepts and confidence scores.' It specifies the verb ('classify'), resource ('text'), and output type ('research concepts and confidence scores'), making the function unambiguous. However, it doesn't differentiate from sibling tools like 'search_topics' or 'get_entity', which might have overlapping domains, so it doesn't achieve the highest score.

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 any context, prerequisites, or exclusions, such as when to prefer 'search_topics' for broader searches or 'get_entity' for specific entities. This lack of usage context leaves the agent without clear direction for tool selection among siblings.

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