wiki.get
Retrieve Wikipedia summaries by article title to quickly access key information without browsing full pages. Supports multiple languages for global content access.
Instructions
Wikipedia summary by title.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| lang | No |
Implementation Reference
- src/server.ts:211-217 (registration)Registration of the 'wiki.get' MCP tool, including inline handler that delegates to wikiGet helper and formats response.server.tool('wiki.get', 'Wikipedia summary by title.', wikiGetShape, OPEN, async ({ title, lang }) => { const res = await wikiGet(title, lang || 'vi'); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; } );
- src/server.ts:210-210 (schema)Zod input schema definition for wiki.get tool.const wikiGetShape = { title: z.string(), lang: z.string().optional() };
- src/tools/scholar.ts:17-29 (handler)Main handler logic: fetches Wikipedia summary using REST API and returns structured data.export async function wikiGet(title: string, lang = 'vi') { const url = `https://${lang}.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(title)}`; const res = await fetchWithLimits(url, 8000, 1024*1024); if (!res.body) return null; const data = JSON.parse(res.body.toString('utf-8')); return { title: data.title, url: data.content_urls?.desktop?.page || data.canonical || '', abstract: data.extract || '', source: 'wikipedia', updatedAt: data.timestamp || new Date().toISOString() }; }
- src/server.ts:218-223 (registration)Registration of alias 'wiki_get' for the wiki.get tool.server.tool('wiki_get', 'Alias of wiki.get', wikiGetShape, OPEN, async ({ title, lang }) => { const res = await wikiGet(title, lang || 'vi'); return { content: [{ type: 'text', text: JSON.stringify(res) }] }; }