search_topics
Search research topics in OpenAlex's scholarly database using queries, filters, and sorting to find relevant academic concepts.
Instructions
Search research topics (formerly concepts)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| search | No | Full-text search query | |
| filter | No | Key:value OpenAlex filters. Supports entity attributes (e.g., 'domain.id', 'level'), IDs, and convenience filters (e.g., 'display_name.search'). Example: 'domain.id:D1,level:0' | |
| sort | No | Sort field with optional :desc | |
| page | No | Page number | |
| per_page | No | Results per page (max 200) | |
| cursor | No | Cursor for deep pagination | |
| group_by | No | Group results by field | |
| select | No | Fields to return | |
| sample | No | Random sample size | |
| seed | No | Random seed | |
| mailto | No | Email for rate limits | |
| api_key | No | Premium API key |
Implementation Reference
- src/tools/searchTopics.ts:3-10 (handler)The main handler function for the 'search_topics' tool. It invokes makeOpenAlexRequest on the '/topics' endpoint with the input arguments and returns the prettified JSON response wrapped in MCP content format.export async function searchTopics(args: any) { return { content: [{ type: "text", text: JSON.stringify(await makeOpenAlexRequest("/topics", args), null, 2) }] }; }
- src/index.ts:144-160 (schema)Defines the input schema (parameters and types) for the search_topics tool used in tool listing and validation.inputSchema: { type: "object", properties: { search: { type: "string", description: "Full-text search query" }, filter: { type: "string", description: "Key:value OpenAlex filters. Supports entity attributes (e.g., 'domain.id', 'level'), IDs, and convenience filters (e.g., 'display_name.search'). Example: 'domain.id:D1,level:0'" }, sort: { type: "string", description: "Sort field with optional :desc" }, page: { type: "number", description: "Page number" }, per_page: { type: "number", description: "Results per page (max 200)" }, cursor: { type: "string", description: "Cursor for deep pagination" }, group_by: { type: "string", description: "Group results by field" }, select: { type: "string", description: "Fields to return" }, sample: { type: "number", description: "Random sample size" }, seed: { type: "number", description: "Random seed" }, mailto: { type: "string", description: "Email for rate limits" }, api_key: { type: "string", description: "Premium API key" } } }
- src/index.ts:141-161 (registration)Registers the search_topics tool in the MCP listTools response, including its name, description, and input schema.{ name: "search_topics", description: "Search research topics (formerly concepts)", inputSchema: { type: "object", properties: { search: { type: "string", description: "Full-text search query" }, filter: { type: "string", description: "Key:value OpenAlex filters. Supports entity attributes (e.g., 'domain.id', 'level'), IDs, and convenience filters (e.g., 'display_name.search'). Example: 'domain.id:D1,level:0'" }, sort: { type: "string", description: "Sort field with optional :desc" }, page: { type: "number", description: "Page number" }, per_page: { type: "number", description: "Results per page (max 200)" }, cursor: { type: "string", description: "Cursor for deep pagination" }, group_by: { type: "string", description: "Group results by field" }, select: { type: "string", description: "Fields to return" }, sample: { type: "number", description: "Random sample size" }, seed: { type: "number", description: "Random seed" }, mailto: { type: "string", description: "Email for rate limits" }, api_key: { type: "string", description: "Premium API key" } } } },
- src/index.ts:289-290 (registration)Switch case in callTool handler that routes 'search_topics' calls to the searchTopics function.case "search_topics": return await searchTopics(args);
- src/index.ts:26-26 (registration)Import statement that brings the searchTopics handler into the main index file for use in tool dispatching.import { searchTopics } from "./tools/searchTopics.js";