check_availability
Verify AlphaFold structure prediction availability for a UniProt ID using the AlphaFold MCP Server. Input a UniProt accession to confirm prediction readiness.
Instructions
Check if AlphaFold structure prediction is available for a UniProt ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uniprotId | Yes | UniProt accession to check |
Implementation Reference
- src/index.ts:741-780 (handler)The handler function for the 'check_availability' tool. It validates input, queries the AlphaFold API endpoint `/prediction/{uniprotId}`, checks if structures exist, and returns a JSON object with availability status, structure count, latest version, and model creation date. Handles errors by returning unavailable status with error message.private async handleCheckAvailability(args: any) { if (!isValidUniProtArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid availability check arguments'); } try { const response = await this.apiClient.get(`/prediction/${args.uniprotId}`); const structures = response.data; const availability = { uniprotId: args.uniprotId, available: structures && structures.length > 0, structureCount: structures ? structures.length : 0, latestVersion: structures && structures.length > 0 ? structures[0].latestVersion : null, modelCreatedDate: structures && structures.length > 0 ? structures[0].modelCreatedDate : null, }; return { content: [ { type: 'text', text: JSON.stringify(availability, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ uniprotId: args.uniprotId, available: false, error: error instanceof Error ? error.message : 'Unknown error' }, null, 2), }, ], }; } }
- src/index.ts:375-380 (schema)Input schema definition for the 'check_availability' tool, specifying a required 'uniprotId' string parameter.type: 'object', properties: { uniprotId: { type: 'string', description: 'UniProt accession to check' }, }, required: ['uniprotId'], },
- src/index.ts:583-584 (registration)Registration/dispatch in the CallToolRequestSchema switch statement that routes calls to the 'check_availability' handler.case 'check_availability': return this.handleCheckAvailability(args);
- src/index.ts:372-381 (registration)Tool registration in the ListToolsRequestSchema response, defining name, description, and input schema.name: 'check_availability', description: 'Check if AlphaFold structure prediction is available for a UniProt ID', inputSchema: { type: 'object', properties: { uniprotId: { type: 'string', description: 'UniProt accession to check' }, }, required: ['uniprotId'], }, },
- src/index.ts:58-68 (helper)Helper validation function used by check_availability (and others) to validate uniprotId input parameter.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)) ); };