Skip to main content
Glama

validate_accession

Validate UniProt accession numbers to ensure data accuracy and prevent errors in protein database queries.

Instructions

Check if accession numbers are valid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accessionYesUniProt accession number to validate

Implementation Reference

  • The handler function for the 'validate_accession' tool. It validates a UniProt accession by attempting to fetch the protein data from the UniProt API. Returns validation result including whether it exists, entry type, etc.
    private async handleValidateAccession(args: any) { if (!isValidAccessionValidateArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid accession validation arguments'); } try { const response = await this.apiClient.get(`/uniprotkb/${args.accession}`, { params: { format: 'json' }, }); const validationResult = { accession: args.accession, isValid: true, entryType: response.data.entryType, primaryAccession: response.data.primaryAccession, exists: true, }; return { content: [ { type: 'text', text: JSON.stringify(validationResult, null, 2), }, ], }; } catch (error) { const validationResult = { accession: args.accession, isValid: false, exists: false, error: error instanceof Error ? error.message : 'Unknown error', }; return { content: [ { type: 'text', text: JSON.stringify(validationResult, null, 2), }, ], }; } }
  • src/index.ts:698-708 (registration)
    Registration of the 'validate_accession' tool in the ListTools response, including name, description, and input schema.
    { name: 'validate_accession', description: 'Check if accession numbers are valid', inputSchema: { type: 'object', properties: { accession: { type: 'string', description: 'UniProt accession number to validate' }, }, required: ['accession'], }, },
  • src/index.ts:782-783 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes to the validate_accession handler.
    case 'validate_accession': return this.handleValidateAccession(args);
  • Helper function to validate the input arguments for the validate_accession tool.
    const isValidAccessionValidateArgs = ( args: any ): args is { accession: string } => { return ( typeof args === 'object' && args !== null && typeof args.accession === 'string' && args.accession.length > 0 ); };

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

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