Skip to main content
Glama
stampchain-io

Stampchain MCP Server

Official

get_token_info

Retrieve comprehensive SRC-20 token details by ticker symbol, including optional holder statistics and recent transfers, using the Stampchain MCP Server.

Instructions

Retrieve detailed information about a specific SRC-20 token by its ticker symbol

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_holdersNoWhether to include holder statistics
include_transfersNoWhether to include recent transfer data
tickYesThe ticker symbol of the SRC-20 token

Implementation Reference

  • The async execute method in GetTokenInfoTool class implements the tool logic: validates params, searches for the token via API, verifies match, formats response with token details, deployment info, and JSON.
    public async execute(params: GetTokenInfoParams, context?: ToolContext): Promise<ToolResponse> { try { context?.logger?.info('Executing get_token_info tool', { params }); // Validate parameters const validatedParams = this.validateParams(params); // Search for the specific token const tokenResponse = await this.apiClient.searchTokens({ query: validatedParams.tick, page: 1, page_size: 1, }); if (!tokenResponse || !tokenResponse || tokenResponse.length === 0) { throw new ToolExecutionError( `Token with ticker ${validatedParams.tick} not found`, this.name, { tick: validatedParams.tick } ); } const token = tokenResponse[0]; // Verify exact match (case-insensitive) if (token.tick.toLowerCase() !== validatedParams.tick.toLowerCase()) { throw new ToolExecutionError( `Token with ticker ${validatedParams.tick} not found (found ${token.tick} instead)`, this.name, { requestedTick: validatedParams.tick, foundTick: token.tick } ); } const contents = []; // Add formatted token info contents.push({ type: 'text' as const, text: formatToken(token) }); // Add deployment information const stats = [ '\nDeployment Information:', '---', `Block Index: ${token.block_index}`, `Block Time: ${new Date(token.block_time).toLocaleString()}`, `Transaction Hash: ${token.tx_hash}`, ]; if (token.creator_name) { stats.push(`Creator: ${token.creator_name} (${token.creator})`); } else { stats.push(`Creator: ${token.creator}`); } contents.push({ type: 'text' as const, text: stats.join('\n') }); // Note about additional data if (validatedParams.include_holders || validatedParams.include_transfers) { contents.push({ type: 'text' as const, text: '\nNote: Detailed holder and transfer data requires additional API endpoints that may not be available in the current implementation.', }); } // Add JSON representation contents.push(tokenToJSON(token)); return multiResponse(...contents); } catch (error) { context?.logger?.error('Error executing get_token_info tool', { error }); if (error instanceof ValidationError) { throw error; } if (error instanceof ToolExecutionError) { throw error; } throw new ToolExecutionError('Failed to retrieve token information', this.name, error); } }
  • Zod schema defining input parameters for get_token_info tool: required tick (validated ticker), optional booleans for including holders and transfers.
    export const GetTokenInfoParamsSchema = z.object({ tick: TokenTickerSchema.describe('The ticker symbol of the SRC-20 token'), include_holders: z .boolean() .optional() .default(false) .describe('Whether to include holder statistics'), include_transfers: z .boolean() .optional() .default(false) .describe('Whether to include recent transfer data'), });
  • getAvailableToolNames function lists 'get_token_info' among all available MCP tools.
    export function getAvailableToolNames(): string[] { return [ // Stamp tools 'get_stamp', 'search_stamps', 'get_recent_stamps', 'get_recent_sales', 'get_market_data', 'get_stamp_market_data', // Collection tools 'get_collection', 'search_collections', // Token tools 'get_token_info', 'search_tokens', // Analysis tools 'analyze_stamp_code', 'get_stamp_dependencies', 'analyze_stamp_patterns', ]; }
  • Export of tokenTools object registering GetTokenInfoTool under 'get_token_info' key for inclusion in main tools index.
    export const tokenTools = { get_token_info: GetTokenInfoTool, search_tokens: SearchTokensTool, };
  • toolMetadata categorizes and lists 'get_token_info' under SRC-20 Tokens tools.
    tokens: { category: 'SRC-20 Tokens', description: 'Tools for SRC-20 token information', tools: ['get_token_info', 'search_tokens'], },

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/stampchain-io/stampchain-mcp'

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