sch_search
Perform scholarly research by querying academic sources within TOOL4LM. Input a search term, adjust result limits, and retrieve relevant scholarly data directly.
Instructions
Alias of sch.search
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| q | Yes | ||
| top | No |
Implementation Reference
- src/tools/scholar.ts:70-77 (handler)Core handler function for sch_search that aggregates academic search results from arXiv, Crossref, and Wikipedia.export async function schSearch(q: string, top = 5) { const [ax, cr, wiki] = await Promise.all([ arxivSearch(q, top), crossrefSearch(q, top), wikiSearch(q, 'en', top) ]); return [...ax, ...cr, ...wiki].slice(0, top * 2); }
- src/server.ts:159-159 (schema)Zod schema defining input parameters for the sch_search tool (q, top, limit).const schSearchShape = { q: z.string(), top: z.number().int().optional(), limit: z.number().int().optional() };
- src/server.ts:167-173 (registration)MCP server registration for the 'sch_search' tool, which wraps and calls the schSearch handler.server.tool('sch_search', 'Alias of sch.search', schSearchShape, OPEN, async ({ q, top, limit }) => { const res = await schSearch(q, top ?? limit ?? 5); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; } );
- src/server.ts:160-166 (registration)Primary MCP server registration for 'sch.search' tool (sch_search is an alias), delegating to schSearch.server.tool('sch.search', 'Academic-first search (arXiv + Crossref + Wikipedia).', schSearchShape, OPEN, async ({ q, top, limit }) => { const res = await schSearch(q, top ?? limit ?? 5); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; } );