Skip to main content
Glama

get_structure_info

Retrieve detailed information about a specific PDB structure by providing its PDB ID. Output formats include JSON, PDB, mmCIF, or XML for flexible use in analysis and research.

Instructions

Get detailed information for a specific PDB structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format (default: json)
pdb_idYesPDB ID (4-character code, e.g., 1ABC)

Implementation Reference

  • The handler function that validates input, fetches PDB structure data from RCSB API based on pdb_id and optional format, and returns the content or error.
    private async handleGetStructureInfo(args: any) { if (!isValidPDBIdArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid PDB ID arguments'); } try { const pdbId = args.pdb_id.toLowerCase(); const format = args.format || 'json'; if (format === 'json') { const response = await this.apiClient.get(`/core/entry/${pdbId}`); return { content: [ { type: 'text', text: JSON.stringify(response.data, null, 2), }, ], }; } else { // Handle file format downloads const baseUrl = 'https://files.rcsb.org/download'; const extension = format === 'mmcif' ? 'cif' : format; const url = `${baseUrl}/${pdbId}.${extension}`; const response = await axios.get(url); return { content: [ { type: 'text', text: response.data, }, ], }; } } catch (error) { return { content: [ { type: 'text', text: `Error fetching structure info: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; } }
  • src/index.ts:256-267 (registration)
    Tool registration in the ListTools response, including name, description, and input schema definition.
    { name: 'get_structure_info', description: 'Get detailed information for a specific PDB structure', inputSchema: { type: 'object', properties: { pdb_id: { type: 'string', description: 'PDB ID (4-character code, e.g., 1ABC)' }, format: { type: 'string', enum: ['json', 'pdb', 'mmcif', 'xml'], description: 'Output format (default: json)' }, }, required: ['pdb_id'], }, },
  • Input schema definition for the get_structure_info tool, specifying parameters and validation rules.
    inputSchema: { type: 'object', properties: { pdb_id: { type: 'string', description: 'PDB ID (4-character code, e.g., 1ABC)' }, format: { type: 'string', enum: ['json', 'pdb', 'mmcif', 'xml'], description: 'Output format (default: json)' }, }, required: ['pdb_id'], },
  • Helper function for validating the input arguments for PDB ID and optional format used in the handler.
    const isValidPDBIdArgs = ( args: any ): args is { pdb_id: string; format?: 'json' | 'pdb' | 'mmcif' | 'xml' } => { return ( typeof args === 'object' && args !== null && typeof args.pdb_id === 'string' && args.pdb_id.length === 4 && /^[0-9][a-zA-Z0-9]{3}$/i.test(args.pdb_id) && (args.format === undefined || ['json', 'pdb', 'mmcif', 'xml'].includes(args.format)) ); };
  • src/index.ts:313-314 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the tool's handler function.
    case 'get_structure_info': return this.handleGetStructureInfo(args);

Other Tools

Related Tools

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/PDB-MCP-Server'

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