osrs_wiki_search
Search the Old School RuneScape Wiki for specific terms, retrieve relevant pages, and control result limits and pagination for precise data access.
Instructions
Search the OSRS Wiki for pages matching a search term.
Input Schema
TableJSON 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 |
Implementation Reference
- index.ts:391-405 (handler)The handler function for the 'osrs_wiki_search' tool. Parses input arguments using Zod schema, makes an API request to the OSRS Wiki search endpoint with configurable limit and offset, and returns the search results.case "osrs_wiki_search": const wikiSearchArgs = getSchemaForTool(name).parse(args) as { search: string; limit?: number; offset?: number }; const { search, limit = 10, offset = 0 } = wikiSearchArgs; 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:38-42 (schema)Zod schema defining the input parameters for the osrs_wiki_search tool: required 'search' string, optional 'limit' (1-50), and 'offset' (0+).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:302-304 (registration)Tool registration in the listTools response: defines the tool name and description for discovery.name: "osrs_wiki_search", description: "Search the OSRS Wiki for pages matching a search term.", },
- index.ts:260-260 (registration)Registers the JSON schema for the tool in getToolSchemas() used for tool call validation.osrsWikiSearch: convertZodToJsonSchema(OsrsWikiSearchSchema),
- index.ts:277-278 (schema)Schema lookup in getSchemaForTool() switch statement, returns the Zod schema for validation during tool execution.case "osrs_wiki_search": return OsrsWikiSearchSchema;