Skip to main content
Glama

batch_structure_info

Retrieve detailed or summarized structure information for up to 50 proteins at once using UniProt IDs, with output available in JSON or summary formats for streamlined analysis.

Instructions

Get structure information for multiple proteins simultaneously

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (default: json)
uniprotIdsYesArray of UniProt accessions (max 50)

Implementation Reference

  • The handler function that executes the batch_structure_info tool. It validates input, loops over uniprotIds, fetches structure predictions from AlphaFold API, and returns batched results.
    private async handleBatchStructureInfo(args: any) { if (!isValidBatchArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid batch structure info arguments'); } try { const results = []; for (const uniprotId of args.uniprotIds) { try { const response = await this.apiClient.get(`/prediction/${uniprotId}`); const structures = response.data; if (structures && structures.length > 0) { const structure = structures[0]; results.push({ uniprotId, success: true, data: args.format === 'summary' ? { entryId: structure.entryId, gene: structure.gene, organism: structure.organismScientificName, sequenceLength: structure.uniprotSequence.length, modelCreatedDate: structure.modelCreatedDate, } : structure, }); } else { results.push({ uniprotId, success: false, error: 'No structure found', }); } } catch (error) { results.push({ uniprotId, success: false, error: error instanceof Error ? error.message : 'Unknown error', }); } } return { content: [ { type: 'text', text: JSON.stringify({ batchResults: results }, null, 2), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error in batch structure info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • The input schema definition for the batch_structure_info tool, specifying parameters uniprotIds (array of strings, 1-50) and optional format.
    name: 'batch_structure_info', description: 'Get structure information for multiple proteins simultaneously', inputSchema: { type: 'object', properties: { uniprotIds: { type: 'array', items: { type: 'string' }, description: 'Array of UniProt accessions (max 50)', minItems: 1, maxItems: 50 }, format: { type: 'string', enum: ['json', 'summary'], description: 'Output format (default: json)' }, }, required: ['uniprotIds'], }, },
  • src/index.ts:600-601 (registration)
    The switch case that registers and dispatches calls to the batch_structure_info handler in the CallToolRequestSchema handler.
    case 'batch_structure_info': return this.handleBatchStructureInfo(args);
  • Helper validation function isValidBatchArgs used to validate input arguments for the batch_structure_info tool.
    const isValidBatchArgs = ( args: any ): args is { uniprotIds: string[]; format?: string } => { return ( typeof args === 'object' && args !== null && Array.isArray(args.uniprotIds) && args.uniprotIds.length > 0 && args.uniprotIds.length <= 50 && args.uniprotIds.every((id: any) => typeof id === 'string' && id.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