Skip to main content
Glama
stampchain-io

Stampchain MCP Server

Official

get_recent_stamps

Retrieve recently created Bitcoin stamps to monitor new blockchain-based digital assets and track emerging collections.

Instructions

Retrieve the most recently created Bitcoin stamps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of recent stamps to retrieve

Implementation Reference

  • Handler function implementing the get_recent_stamps tool logic. Validates input, calls searchStamps API with DESC sort order and specified limit, formats and returns list of recent stamps.
    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 for input parameters of get_recent_stamps tool, defining 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>;
  • Registration of GetRecentStampsTool class in the stampTools export object.
    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 instantiates GetRecentStampsTool and registers it in the tools map.
    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),
      };
    }
  • Tool name listed in getAvailableToolNames() for discovery and in toolMetadata.
        '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',
      ];
    }
    
    /**
     * Tool metadata for discovery
     */
    export const toolMetadata = {
      stamps: {
        category: 'Bitcoin Stamps',
        description: 'Tools for querying and searching Bitcoin stamps',
        tools: [
          'get_stamp',
          'search_stamps',
          'get_recent_stamps',
  • Supporting API client method getRecentStamps (though tool uses searchStamps directly).
    async getRecentStamps(limit: number = 20): Promise<Stamp[]> {
      const params: StampQueryParams = {
        limit,
      };
      const response = await this.client.get<StampListResponse>('/stamps', { params });
      return response.data.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but doesn't cover key traits like whether this is a read-only operation, potential rate limits, authentication needs, or what the return format looks like (e.g., list of stamps with details). This is inadequate for a tool with no annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'Bitcoin stamps' are, what data is returned (e.g., fields like ID, timestamp, content), or behavioral aspects like pagination or errors. For a tool with no structured support, this leaves significant gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, fully documenting the 'limit' parameter with details on type, range, and default. The description adds no additional parameter semantics beyond implying 'recent' ordering, which is already suggested by the tool name. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve' and resource 'most recently created Bitcoin stamps', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_recent_sales' or 'search_stamps', which might also retrieve recent stamps with different filters or scopes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives such as 'get_stamp' for specific stamps or 'search_stamps' for filtered searches. It lacks explicit context, prerequisites, or exclusions, leaving the agent to infer usage based on the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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