autocomplete_search
Find organisms in the ITIS database by entering partial scientific names to get autocomplete suggestions for accurate taxonomic searches.
Instructions
Search for organisms with autocomplete functionality using partial names.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| partialName | Yes | Partial scientific name for autocomplete (e.g., "Homo", "Quer") | |
| rows | No | Number of results to return (default: 10) |
Implementation Reference
- src/tools.ts:376-396 (handler)Handler for executing the autocomplete_search tool: extracts parameters, calls ITIS client method, formats response with suggestions.case 'autocomplete_search': { const { partialName, rows } = args as any; const result = await itisClient.searchWithAutocomplete(partialName, { rows }); return { content: [ { type: 'text', text: JSON.stringify({ partialName, totalResults: result.response.numFound, suggestions: result.response.docs.map((doc: any) => ({ tsn: doc.tsn, name: doc.nameWInd, kingdom: doc.kingdom, rank: doc.rank, })), }, null, 2), }, ], }; }
- src/tools.ts:141-158 (schema)Tool schema defining name, description, and input parameters for autocomplete_search.{ name: 'autocomplete_search', description: 'Search for organisms with autocomplete functionality using partial names.', inputSchema: { type: 'object', properties: { partialName: { type: 'string', description: 'Partial scientific name for autocomplete (e.g., "Homo", "Quer")', }, rows: { type: 'number', description: 'Number of results to return (default: 10)', }, }, required: ['partialName'], }, },
- src/itis-client.ts:194-200 (helper)Core helper method implementing autocomplete logic by constructing SOLR wildcard query on scientific names.async searchWithAutocomplete(partialName: string, options: Partial<ITISSearchOptions> = {}): Promise<ITISResponse> { return this.search({ ...options, query: `nameWInd:${partialName}*`, sort: 'nameWInd asc' }); }
- src/tools.ts:261-265 (registration)Registration of available tools list including autocomplete_search for MCP ListToolsRequest.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools, }; });