Skip to main content
Glama

deployment_history

View and filter deployment history by network, contract name, or status, then export to JSON, CSV, or Markdown for tracking, auditing, and documentation.

Instructions

View deployment history with filtering and export.

FILTERS: By network, contract name, status EXPORTS: JSON, CSV, or Markdown format

USE FOR: Tracking deployments, auditing, documentation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNo
contractNameNoFilter by name
limitNoMax results (default: 20)
exportFormatNo

Implementation Reference

  • The primary handler function implementing the deployment_history tool logic. It queries the deployment service for filtered records, applies pagination, supports multiple export formats (JSON, CSV, Markdown), handles errors, and returns a standardized ToolResult object.
    export async function deploymentHistory(args: {
      network?: HederaNetwork;
      contractName?: string;
      status?: 'pending' | 'deploying' | 'deployed' | 'failed' | 'verified';
      limit?: number;
      offset?: number;
      exportFormat?: 'json' | 'csv' | 'markdown';
    }): Promise<ToolResult> {
      try {
        const limit = args.limit || 20;
        const offset = args.offset || 0;
        const exportFormat = args.exportFormat || 'json';
    
        logger.info('Fetching deployment history', {
          network: args.network,
          contractName: args.contractName,
          status: args.status,
          limit,
          offset,
        });
    
        const records = deploymentService.getDeploymentHistory({
          network: args.network,
          contractName: args.contractName,
          status: args.status,
          limit: limit + offset, // Get limit + offset to handle pagination
        });
    
        // Apply offset
        const paginatedRecords = records.slice(offset, offset + limit);
        const totalCount = records.length;
        const hasMore = totalCount > offset + limit;
    
        let data: any = {
          deployments: paginatedRecords,
          pagination: {
            offset,
            limit,
            total: totalCount,
            returned: paginatedRecords.length,
            hasMore,
          },
        };
    
        // Format output
        if (exportFormat === 'csv') {
          const csv = convertToCSV(paginatedRecords);
          data = { csv, ...data.pagination };
        } else if (exportFormat === 'markdown') {
          const markdown = convertToMarkdown(paginatedRecords);
          data = { markdown, ...data.pagination };
        }
    
        return {
          success: true,
          data,
          metadata: {
            executedVia: 'deployment-service',
            command: 'deployment_history',
          },
        };
      } catch (error: any) {
        logger.error('Failed to fetch deployment history', { error: error.message });
        return {
          success: false,
          error: error.message,
          metadata: {
            executedVia: 'deployment-service',
            command: 'deployment_history',
          },
        };
      }
    }
  • The input schema and tool definition for 'deployment_history' as registered in the MCP server's optimizedToolDefinitions array, used by listTools for validation and documentation.
      {
        name: 'deployment_history',
        description: `View deployment history with filtering and export.
    
    FILTERS: By network, contract name, status
    EXPORTS: JSON, CSV, or Markdown format
    
    USE FOR: Tracking deployments, auditing, documentation.`,
        inputSchema: {
          type: 'object' as const,
          properties: {
            network: {
              type: 'string',
              enum: ['mainnet', 'testnet', 'previewnet'],
            },
            contractName: { type: 'string', description: 'Filter by name' },
            limit: { type: 'number', description: 'Max results (default: 20)' },
            exportFormat: {
              type: 'string',
              enum: ['json', 'csv', 'markdown'],
            },
          },
        },
      },
  • src/index.ts:639-641 (registration)
    Registration in the MCP tool execution dispatcher (switch statement) that routes calls to the deployment_history tool to the imported deploymentHistory handler function.
    case 'deployment_history':
      result = await deploymentHistory(args as any);
      break;
  • Key helper method in DeploymentService that filters, sorts by date (newest first), limits, and returns deployment records from persistent JSON storage. Called directly by the tool handler.
    getDeploymentHistory(filters?: {
      network?: HederaNetwork;
      contractName?: string;
      status?: DeploymentStatus;
      limit?: number;
    }): DeploymentRecord[] {
      let filtered = [...this.deploymentHistory];
    
      if (filters?.network) {
        filtered = filtered.filter((r) => r.network === filters.network);
      }
    
      if (filters?.contractName) {
        filtered = filtered.filter((r) => r.contractName === filters.contractName);
      }
    
      if (filters?.status) {
        filtered = filtered.filter((r) => r.status === filters.status);
      }
    
      // Sort by most recent first
      filtered.sort((a, b) => new Date(b.deployedAt).getTime() - new Date(a.deployedAt).getTime());
    
      if (filters?.limit) {
        filtered = filtered.slice(0, filters.limit);
      }
    
      return filtered;
    }
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. It mentions filtering and export capabilities, but doesn't disclose behavioral traits such as whether this is a read-only operation (implied by 'view'), potential rate limits, authentication needs, or what the output looks like (e.g., pagination, error handling). For a tool with no annotations, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is well-structured with sections (FILTERS, EXPORTS, USE FOR) and uses bullet-like formatting for clarity. It's concise, with each sentence adding value, though it could be more front-loaded by starting with the core purpose. No wasted words, but minor improvements in flow are possible.

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

Completeness3/5

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

Given no annotations, no output schema, and 4 parameters with 50% schema coverage, the description provides basic context but is incomplete. It covers what the tool does and some parameter semantics, but lacks details on behavioral aspects, output format, or error handling. For a tool with moderate complexity, this is adequate but has clear gaps.

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?

Schema description coverage is 50%, with parameters 'network' and 'exportFormat' having enums and 'contractName' and 'limit' having brief descriptions. The description adds value by listing filters (network, contract name, status) and export formats (JSON, CSV, Markdown), which clarifies the purpose of some parameters. However, it doesn't fully compensate for the coverage gap, as 'status' is mentioned but not in the schema, and details like default values or usage are sparse.

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 tool's purpose: 'View deployment history with filtering and export.' It specifies the resource (deployment history) and actions (view, filter, export). However, it doesn't explicitly differentiate from sibling tools like 'deploy_contract' or 'verify_contract' which might also involve deployment operations, though the focus on history tracking is implied.

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

Usage Guidelines3/5

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

The description includes 'USE FOR: Tracking deployments, auditing, documentation,' which provides context on when to use this tool. However, it lacks explicit guidance on when not to use it or alternatives among siblings (e.g., 'deploy_contract' for new deployments vs. this for history). The guidance is implied but not comprehensive.

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/justmert/hashpilot'

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