Skip to main content
Glama

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
NameRequiredDescriptionDefault
uniprotIdYesUniProt accession to check

Implementation Reference

  • 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), }, ], }; } }
  • 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'], }, },
  • 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)) ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Augmented-Nature/AlphaFold-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server