validate_structure_quality
Assess and validate the quality of AlphaFold protein structure predictions using a UniProt accession ID to ensure reliability and accuracy.
Instructions
Validate and assess the overall quality of an AlphaFold prediction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uniprotId | Yes | UniProt accession |
Implementation Reference
- src/index.ts:1497-1553 (handler)Main handler function executing the tool logic: validates input, fetches AlphaFold structure data, computes quality metrics like coverage and overall score, provides recommendations and warnings.private async handleValidateStructureQuality(args: any) { if (!isValidUniProtArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid structure quality validation arguments'); } try { const response = await this.apiClient.get(`/prediction/${args.uniprotId}`); const structures = response.data; if (!structures || structures.length === 0) { return { content: [ { type: 'text', text: `No structure available for ${args.uniprotId}`, }, ], }; } const structure = structures[0]; // Mock quality validation const quality = { uniprotId: args.uniprotId, overallQuality: 'HIGH', qualityScore: 0.85, coverage: ((structure.uniprotEnd - structure.uniprotStart + 1) / structure.uniprotSequence.length) * 100, recommendations: [ 'Structure has high confidence in core domains', 'Terminal regions may have lower reliability', 'Suitable for most structural analyses', ], warnings: structure.uniprotStart > 10 || structure.uniprotEnd < structure.uniprotSequence.length - 10 ? ['Incomplete sequence coverage detected'] : [], }; return { content: [ { type: 'text', text: JSON.stringify(quality, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error validating structure quality: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
- src/index.ts:526-536 (registration)Tool registration in the ListTools response, including name, description, and input schema.{ name: 'validate_structure_quality', description: 'Validate and assess the overall quality of an AlphaFold prediction', inputSchema: { type: 'object', properties: { uniprotId: { type: 'string', description: 'UniProt accession' }, }, required: ['uniprotId'], }, },
- src/index.ts:614-615 (registration)Dispatch/registration in the CallToolRequestSchema switch statement mapping tool name to handler.case 'validate_structure_quality': return this.handleValidateStructureQuality(args);
- src/index.ts:529-536 (schema)Input schema definition for the tool, specifying required uniprotId parameter.inputSchema: { type: 'object', properties: { uniprotId: { type: 'string', description: 'UniProt accession' }, }, required: ['uniprotId'], }, },
- src/index.ts:58-68 (helper)Type guard/helper function used in the handler for input validation matching the schema.const isValidUniProtArgs = ( args: any ): args is { uniprotId: string; format?: 'pdb' | 'cif' | 'bcif' | 'json' } => { return ( typeof args === 'object' && args !== null && typeof args.uniprotId === 'string' && args.uniprotId.length > 0 && (args.format === undefined || ['pdb', 'cif', 'bcif', 'json'].includes(args.format)) ); };