osrs_wiki_search
Search the Old School RuneScape (OSRS) Wiki for pages matching specific terms using a dedicated tool. Retrieve relevant results with customizable limits and pagination offsets for precise queries.
Instructions
Search the OSRS Wiki for pages matching a search term.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results to return (1-50) | |
| offset | No | Offset for pagination (0-based) | |
| search | Yes | The term to search for on the OSRS Wiki |
Input Schema (JSON Schema)
{
"additionalProperties": false,
"properties": {
"limit": {
"description": "Number of results to return (1-50)",
"maximum": 50,
"minimum": 1,
"type": "integer"
},
"offset": {
"description": "Offset for pagination (0-based)",
"minimum": 0,
"type": "integer"
},
"search": {
"description": "The term to search for on the OSRS Wiki",
"type": "string"
}
},
"required": [
"search"
],
"type": "object"
}
Implementation Reference
- index.ts:347-360 (handler)Handler for osrs_wiki_search: parses input, calls OSRS Wiki API search endpoint, formats and returns response.case "osrs_wiki_search": const { search, limit = 10, offset = 0 } = OsrsWikiSearchSchema.parse(args); const searchResponse = await osrsApiClient.get('', { params: { action: 'query', list: 'search', srsearch: search, srlimit: limit, sroffset: offset, srprop: 'snippet|titlesnippet|sectiontitle' } }); return responseToString(searchResponse.data);
- index.ts:35-39 (schema)Zod input schema defining parameters for the osrs_wiki_search tool: search term, optional limit and offset.const OsrsWikiSearchSchema = z.object({ search: z.string().describe("The term to search for on the OSRS Wiki"), limit: z.number().int().min(1).max(50).optional().describe("Number of results to return (1-50)"), offset: z.number().int().min(0).optional().describe("Offset for pagination (0-based)") });
- index.ts:243-247 (registration)Tool registration in listTools handler, including name, description, and converted input schema.{ name: "osrs_wiki_search", description: "Search the OSRS Wiki for pages matching a search term.", inputSchema: convertZodToJsonSchema(OsrsWikiSearchSchema), },
- index.ts:28-33 (helper)Axios client instance configured for OSRS Wiki API calls, used by the handler.const osrsApiClient = axios.create({ baseURL: 'https://oldschool.runescape.wiki/api.php', params: { format: 'json' } });
- index.ts:21-26 (helper)Utility function to format tool responses into MCP content structure.const responseToString = (response: any) => { const contentText = typeof response === 'string' ? response : JSON.stringify(response); return { content: [{ type: "text", text: contentText }] }; };