sch_get
Retrieve scholarly research articles using DOI, arXiv ID, or URL to access academic papers and metadata for research purposes.
Instructions
Alias of sch.get
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doi | No | ||
| arxivId | No | ||
| url | No |
Implementation Reference
- src/tools/scholar.ts:79-105 (handler)Core handler function schGet that fetches scholarly article metadata from Crossref (DOI), arXiv (ID), or extracts DOI from URL.export async function schGet(args: { doi?: string, arxivId?: string, url?: string }) { if (args.doi) { const url = `https://api.crossref.org/works/${encodeURIComponent(args.doi)}`; const res = await fetchWithLimits(url, 8000, 1024*1024); if (res.body) { const it = JSON.parse(res.body.toString('utf-8')).message; return { title: (it.title && it.title[0]) || '', authors: (it.author || []).map((a:any) => [a.given, a.family].filter(Boolean).join(' ')), year: (it.created?.['date-parts']?.[0]?.[0]) || '', doi: it.DOI || '', url: it.URL || '', abstract: (it.abstract || '').replace(/<[^>]+>/g, ''), source: 'crossref' }; } } if (args.arxivId) { const items = await arxivSearch(`id:${args.arxivId}`, 1); return items[0] || null; } if (args.url) { const m = args.url.match(/10\.\d{4,9}\/[-._;()/:A-Z0-9]+/i); if (m) return schGet({ doi: m[0] }); } return null; }
- src/server.ts:184-189 (registration)Registration of the 'sch_get' tool in the MCP server, which proxies to the schGet handler.server.tool('sch_get', 'Alias of sch.get', schGetShape, OPEN, async ({ doi, arxivId, url }) => { const res = await schGet({ doi, arxivId, url }); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; }
- src/server.ts:176-176 (schema)Zod schema defining the input parameters for the sch_get tool.const schGetShape = { doi: z.string().optional(), arxivId: z.string().optional(), url: z.string().optional() };
- src/server.ts:177-183 (registration)Primary registration of the 'sch.get' tool (sch_get is an alias), proxying to schGet handler.server.tool('sch.get', 'Get scholarly metadata by DOI/arXivId/URL.', schGetShape, OPEN, async ({ doi, arxivId, url }) => { const res = await schGet({ doi, arxivId, url }); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; } );