Skip to main content
Glama
reetp14
by reetp14

classify_text

Predict research concepts and confidence scores from text inputs like titles and abstracts to categorize scholarly content.

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 that executes the core logic of the classify_text MCP tool. It extracts title, abstract, and mailto from args, builds params, calls makeOpenAlexRequest to the /text endpoint for classification, and returns the JSON response formatted as MCP tool output.
    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 the expected properties: title, abstract, mailto, and api_key with their types and descriptions.
    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)
    The classify_text tool registration in the ListTools response array, specifying 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 CallToolRequest handler switch statement that routes classify_text calls to the classifyText function.
    case "classify_text": return await classifyText(args);
  • src/index.ts:31-31 (registration)
    Import of the classifyText handler function used by the classify_text tool.
    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