search_properties
Search and retrieve ontology properties by labels, IDs, and specific criteria across biological ontologies. Filter results by exact matches, definitions, property types, and more for precise data exploration.
Instructions
Search ontology properties by their labels and IDs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| also_search_views | No | Include ontology views (default: false) | |
| include | No | Attributes to include (default: label,labelGenerated,definition,parents) | |
| ontologies | No | Comma-separated list of ontology acronyms | |
| ontology_types | No | Ontology types to include (e.g., ONTOLOGY,VALUE_SET_COLLECTION) | |
| page | No | Page number (default: 1) | |
| pagesize | No | Results per page (default: 50, max: 500) | |
| property_types | No | Property types (object,annotation,datatype) | |
| query | Yes | Search query for properties | |
| require_definitions | No | Only return properties with definitions (default: false) | |
| require_exact_match | No | Require exact match (default: false) |
Implementation Reference
- src/index.ts:783-826 (handler)The handler function that validates input arguments and calls the BioOntology API /property_search endpoint to search for ontology properties.private async handleSearchProperties(args: any) { if (!isValidSearchPropertiesArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid search properties arguments'); } try { const params: any = { q: args.query, apikey: this.apiKey, }; // Add optional parameters if (args.ontologies) params.ontologies = args.ontologies; if (args.require_exact_match !== undefined) params.require_exact_match = args.require_exact_match; if (args.also_search_views !== undefined) params.also_search_views = args.also_search_views; if (args.require_definitions !== undefined) params.require_definitions = args.require_definitions; if (args.include) params.include = args.include; if (args.ontology_types) params.ontology_types = args.ontology_types; if (args.property_types) params.property_types = args.property_types; if (args.page) params.page = args.page; if (args.pagesize) params.pagesize = args.pagesize; const response = await this.apiClient.get('/property_search', { params }); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error searching properties: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:550-568 (schema)The tool registration including name, description, and input schema definition for the search_properties tool.{ name: 'search_properties', description: 'Search ontology properties by their labels and IDs', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query for properties' }, ontologies: { type: 'string', description: 'Comma-separated list of ontology acronyms' }, require_exact_match: { type: 'boolean', description: 'Require exact match (default: false)' }, also_search_views: { type: 'boolean', description: 'Include ontology views (default: false)' }, require_definitions: { type: 'boolean', description: 'Only return properties with definitions (default: false)' }, include: { type: 'string', description: 'Attributes to include (default: label,labelGenerated,definition,parents)' }, ontology_types: { type: 'string', description: 'Ontology types to include (e.g., ONTOLOGY,VALUE_SET_COLLECTION)' }, property_types: { type: 'string', description: 'Property types (object,annotation,datatype)' }, page: { type: 'number', description: 'Page number (default: 1)', minimum: 1 }, pagesize: { type: 'number', description: 'Results per page (default: 50, max: 500)', minimum: 1, maximum: 500 }, }, required: ['query'], },
- src/index.ts:96-124 (schema)Type guard function for validating input arguments to the search_properties tool.const isValidSearchPropertiesArgs = ( args: any ): args is { query: string; ontologies?: string; require_exact_match?: boolean; also_search_views?: boolean; require_definitions?: boolean; include?: string; ontology_types?: string; property_types?: string; page?: number; pagesize?: number; } => { return ( typeof args === 'object' && args !== null && typeof args.query === 'string' && (args.ontologies === undefined || typeof args.ontologies === 'string') && (args.require_exact_match === undefined || typeof args.require_exact_match === 'boolean') && (args.also_search_views === undefined || typeof args.also_search_views === 'boolean') && (args.require_definitions === undefined || typeof args.require_definitions === 'boolean') && (args.include === undefined || typeof args.include === 'string') && (args.ontology_types === undefined || typeof args.ontology_types === 'string') && (args.property_types === undefined || typeof args.property_types === 'string') && (args.page === undefined || (typeof args.page === 'number' && args.page > 0)) && (args.pagesize === undefined || (typeof args.pagesize === 'number' && args.pagesize > 0 && args.pagesize <= 500)) ); };
- src/index.ts:703-704 (registration)The switch case that routes calls to the search_properties handler.case 'search_properties': return this.handleSearchProperties(args);