Skip to main content
Glama
stampchain-io

Stampchain MCP Server

Official

get_recent_stamps

Retrieve the most recently created Bitcoin stamps using this tool from Stampchain MCP Server. Specify the limit to fetch up to 100 recent stamps for quick access to blockchain data.

Instructions

Retrieve the most recently created Bitcoin stamps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of recent stamps to retrieve

Implementation Reference

  • The execute method of GetRecentStampsTool class that handles the tool execution: validates params, calls searchStamps API with DESC sort, formats recent stamps list as text response.
    public async execute( params: GetRecentStampsParams, context?: ToolContext ): Promise<ToolResponse> { try { context?.logger?.info('Executing get_recent_stamps tool', { params }); // Validate parameters const validatedParams = this.validateParams(params); // Get recent stamps by searching with sort order DESC const queryParams = { sort_order: 'DESC' as const, page: 1, page_size: validatedParams.limit, }; // Use API client from context if available, otherwise use instance client const client = context?.apiClient || this.apiClient; const stamps: Stamp[] = await client.searchStamps(queryParams); if (!stamps || stamps.length === 0) { return textResponse('No recent stamps found'); } // Create a summary of recent stamps const lines = [`${stamps.length} Most Recent Stamps:`]; lines.push('---'); stamps.forEach((stamp, index) => { lines.push(`${index + 1}. Stamp #${stamp.stamp}`); lines.push(` Block: ${stamp.block_index}`); lines.push(` Creator: ${stamp.creator}`); lines.push(` Type: ${stamp.ident}`); lines.push(` CPID: ${stamp.cpid}`); if (stamp.floorPrice) { lines.push(` Floor Price: ${stamp.floorPrice} BTC`); } lines.push(''); }); return textResponse(lines.join('\n')); } catch (error) { context?.logger?.error('Error executing get_recent_stamps tool', { error }); if (error instanceof ValidationError) { throw error; } if (error instanceof ToolExecutionError) { throw error; } // Pass through the original error message for API errors if (error instanceof Error) { throw new ToolExecutionError(error.message, this.name, error); } throw new ToolExecutionError('Failed to retrieve recent stamps', this.name, error); } }
  • Zod schema and TypeScript type for input parameters of get_recent_stamps tool: optional limit (1-100, default 20).
    export const GetRecentStampsParamsSchema = z.object({ limit: z.number().int().min(1).max(100).optional().default(20), }); export type GetRecentStampsParams = z.infer<typeof GetRecentStampsParamsSchema>;
  • Export of stampTools object registering the GetRecentStampsTool class by name 'get_recent_stamps'.
    export const stampTools = { get_stamp: GetStampTool, search_stamps: SearchStampsTool, get_recent_stamps: GetRecentStampsTool, get_recent_sales: GetRecentSalesTool, get_market_data: GetMarketDataTool, get_stamp_market_data: GetStampMarketDataTool, };
  • Factory function createStampTools that instantiates and registers GetRecentStampsTool instance under 'get_recent_stamps' key.
    export function createStampTools(apiClient?: StampchainClient) { return { get_stamp: new GetStampTool(apiClient), search_stamps: new SearchStampsTool(apiClient), get_recent_stamps: new GetRecentStampsTool(apiClient), get_recent_sales: new GetRecentSalesTool(apiClient), get_market_data: new GetMarketDataTool(apiClient), get_stamp_market_data: new GetStampMarketDataTool(apiClient), }; }
  • StampchainClient.getRecentStamps helper method that fetches recent stamps via API (though tool uses searchStamps directly with similar params).
    async getRecentStamps(limit: number = 20): Promise<Stamp[]> { const params: StampQueryParams = { limit, }; const response = await this.client.get<StampListResponse>('/stamps', { params }); return response.data.data; }
  • Tool name 'get_recent_stamps' listed in getAvailableToolNames array for global tool discovery.
    'get_recent_stamps',

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

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