Skip to main content
Glama
boray
by boray

query-actions

Retrieve Mina blockchain actions with filters for address, token ID, transaction status, block height, and action state parameters.

Instructions

Query actions from the Mina blockchain with optional filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes
tokenIdNoToken ID to filter transactions
statusNoTransaction status to filter
toNoBlock height to filter transactions
fromNoBlock height to filter transactions
fromActionStateNoAction state to filter transactions
endActionStateNoAction state to filter transactions

Implementation Reference

  • MCP tool handler that destructures input parameters, invokes minaClient.queryActions with them, formats the result as JSON text content, and handles errors.
    async ({ address, tokenId, status, to, from, fromActionState, endActionState }) => {
      try {
        const result = await minaClient.queryActions({address, tokenId, status, to, from, fromActionState, endActionState});
        return {
          content: [{
            type: "text",
            text: JSON.stringify(result, null, 2)
          }]
        };
      } catch (error) {
        throw new Error(`Failed to query actions: ${error}`);
      }
    }
  • Zod schema for input validation of the query-actions tool parameters, including required address and optional filters.
    {
      address: z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{55,60}$/, 'Invalid Ethereum address format'),
      tokenId: z.string().optional().describe("Token ID to filter transactions"),
      status: z.enum(Object.values(BlockStatusFilter) as [BlockStatusFilter, ...BlockStatusFilter[]]).optional().describe("Transaction status to filter"),
      to: z.number().optional().describe("Block height to filter transactions"),
      from: z.number().optional().describe("Block height to filter transactions"),
      fromActionState: z.string().optional().describe("Action state to filter transactions"),
      endActionState: z.string().optional().describe("Action state to filter transactions"),
    },
  • src/index.ts:63-88 (registration)
    Registration of the query-actions tool on the MCP server, specifying name, description, input schema, and handler function.
    server.tool(
        "query-actions",
        "Query actions from the Mina blockchain with optional filters",
        {
          address: z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{55,60}$/, 'Invalid Ethereum address format'),
          tokenId: z.string().optional().describe("Token ID to filter transactions"),
          status: z.enum(Object.values(BlockStatusFilter) as [BlockStatusFilter, ...BlockStatusFilter[]]).optional().describe("Transaction status to filter"),
          to: z.number().optional().describe("Block height to filter transactions"),
          from: z.number().optional().describe("Block height to filter transactions"),
          fromActionState: z.string().optional().describe("Action state to filter transactions"),
          endActionState: z.string().optional().describe("Action state to filter transactions"),
        },
        async ({ address, tokenId, status, to, from, fromActionState, endActionState }) => {
          try {
            const result = await minaClient.queryActions({address, tokenId, status, to, from, fromActionState, endActionState});
            return {
              content: [{
                type: "text",
                text: JSON.stringify(result, null, 2)
              }]
            };
          } catch (error) {
            throw new Error(`Failed to query actions: ${error}`);
          }
        }
      );
  • Helper method in MinaGraphQLClient that builds the GraphQL query string from filter options and executes it to fetch action data from the Mina archive node API.
    async queryActions(filterOptions: ActionFilterOptions): Promise<{ actions: ActionOutput[] }> {
      // Convert filter options to GraphQL input format
      const inputParams = Object.entries(filterOptions)
        .filter(([_, value]) => value !== undefined)
        .map(([key, value]) => `${key}: ${typeof value === 'string' ? `"${value}"` : value}`)
        .join(', ');
    
      const query = `
        query {
          actions(input: {${inputParams}}) {
            blockInfo {
              height
              stateHash
              parentHash
              ledgerHash
              chainStatus
              timestamp
              globalSlotSinceHardfork
              globalSlotSinceGenesis
              distanceFromMaxBlockHeight
            }
            transactionInfo {
              status
              hash
              memo
              authorizationKind
              sequenceNumber
              zkappAccountUpdateIds
            }
            actionData {
              accountUpdateId
              data
            }
            actionState {
              actionStateOne
              actionStateTwo
              actionStateThree
              actionStateFour
              actionStateFive
            }
          }
        }
      `;
    
      return this.client.request(query);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a query operation but doesn't mention whether it's read-only, what permissions are needed, how results are returned (e.g., pagination), rate limits, or error conditions. This leaves significant gaps for a tool with 7 parameters.

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 gets straight to the point without any wasted words. It's appropriately sized for a query tool and front-loads the essential information.

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?

For a query tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'actions' are in the Mina blockchain context, what the return format looks like, or how to interpret results. The high schema coverage helps but doesn't compensate for missing behavioral and output context.

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 high at 86%, providing good documentation for most parameters. The description adds minimal value beyond the schema by mentioning 'optional filters' but doesn't explain parameter interactions, default behaviors, or provide examples. Baseline 3 is appropriate given the schema does most of the work.

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 action ('query actions') and resource ('from the Mina blockchain'), making the purpose understandable. However, it doesn't differentiate this tool from its siblings 'get-network-state' and 'query-events', which likely also query blockchain data but for different resources.

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 mentions 'optional filters' but provides no guidance on when to use this tool versus its siblings or what specific scenarios it addresses. There's no mention of prerequisites, alternatives, or exclusion criteria.

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/boray/mcp-mina-archive-node'

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