autocomplete_search
Search for organisms using partial scientific names with autocomplete functionality on the ITIS MCP Server, returning relevant results for taxonomic queries.
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)The handler function that processes the tool call for autocomplete_search, delegating to ITISClient and formatting the autocomplete 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:144-157 (schema)Input schema definition for the autocomplete_search tool.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/tools.ts:141-158 (registration)Registration of the autocomplete_search tool in the exported tools array used for MCP listTools response.{ 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 via SOLR wildcard search on scientific names in ITISClient.async searchWithAutocomplete(partialName: string, options: Partial<ITISSearchOptions> = {}): Promise<ITISResponse> { return this.search({ ...options, query: `nameWInd:${partialName}*`, sort: 'nameWInd asc' }); }