Skip to main content
Glama
reetp14
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";

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