export_protein_data
Export protein-related data in GFF, GenBank, or other formats using a UniProt accession number for specialized analysis and integration.
Instructions
Export data in specialized formats (GFF, GenBank, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accession | Yes | UniProt accession number | |
| format | Yes | Export format |
Implementation Reference
- src/index.ts:1821-1849 (handler)The handler function that executes the tool: validates args, fetches protein data from UniProt API (`/uniprotkb/{accession}`) using the specified format (gff, genbank, embl, xml), and returns the raw response as text or error.private async handleExportProteinData(args: any) { if (!isValidProteinInfoArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid export protein data arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: args.format }, }); return { content: [ { type: 'text', text: String(response.data), }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error exporting protein data: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], isError: true, }; }
- src/index.ts:687-697 (registration)Tool registration entry in ListToolsRequestSchema handler: defines name, description, and inputSchema requiring accession and format.name: 'export_protein_data', description: 'Export data in specialized formats (GFF, GenBank, etc.)', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number' }, format: { type: 'string', enum: ['gff', 'genbank', 'embl', 'xml'], description: 'Export format' }, }, required: ['accession', 'format'], }, },
- src/index.ts:780-781 (registration)Dispatcher case in CallToolRequestSchema handler that maps tool calls to the specific handler method.case 'export_protein_data': return this.handleExportProteinData(args);
- src/index.ts:79-88 (helper)Shared validation helper used in the handler to validate input arguments (accession required, format optional in validator though schema requires it). Supports json/tsv/fasta/xml but tool schema limits to gff/genbank/embl/xml.const isValidProteinInfoArgs = ( args: any ): args is { accession: string; format?: string } => { return ( typeof args === 'object' && args !== null && typeof args.accession === 'string' && args.accession.length > 0 && (args.format === undefined || ['json', 'tsv', 'fasta', 'xml'].includes(args.format)) );