Skip to main content
Glama
CWNApps

TrustAtom MCP Server

by CWNApps

query_receipts

Retrieve verifiable audit receipts for compliance reporting. Filter by time range, action, actor, or decision to generate regulatory documentation.

Instructions

Query the receipt ledger for audit or compliance reporting. Filter by time range, action, actor, or decision.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionNoFilter by action type
actorNoFilter by actor/agent
decisionNoFilter by decision
limitNoMax receipts to return (default: 20)

Implementation Reference

  • Implementation of the `query_receipts` tool handler, which filters the ledger based on action, actor, or decision and returns a formatted JSON response.
    case "query_receipts": {
      let results = [...ledger];
    
      if (args?.action)
        results = results.filter((r) => r.action === args.action);
      if (args?.actor)
        results = results.filter((r) => r.actor === args.actor);
      if (args?.decision)
        results = results.filter((r) => r.decision === args.decision);
    
      const limit = (args?.limit as number) ?? 20;
      results = results.slice(-limit);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                total: results.length,
                receipts: results.map((r) => ({
                  id: r.id,
                  action: r.action,
                  actor: r.actor,
                  decision: r.decision,
                  timestamp: r.timestamp_iso,
                  compliance: r.dct.compliance_tags,
                  risk_score: r.dct.risk_score,
                })),
              },
              null,
              2,
            ),
          },
        ],
      };
    }
  • Input schema definition for `query_receipts`, specifying optional filters for action, actor, decision, and results limit.
    name: "query_receipts",
    description:
      "Query the receipt ledger for audit or compliance reporting. " +
      "Filter by time range, action, actor, or decision.",
    inputSchema: {
      type: "object" as const,
      properties: {
        action: {
          type: "string",
          description: "Filter by action type",
        },
        actor: {
          type: "string",
          description: "Filter by actor/agent",
        },
        decision: {
          type: "string",
          enum: ["ALLOW", "DENY"],
          description: "Filter by decision",
        },
        limit: {
          type: "number",
          description: "Max receipts to return (default: 20)",
        },
      },
    },
  • src/server.ts:90-90 (registration)
    Registration point for the `query_receipts` tool.
    name: "query_receipts",
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 mentions querying for audit/compliance reporting but doesn't disclose critical traits like whether this is a read-only operation, if it requires specific permissions, rate limits, pagination behavior, or what the response format looks like. For a query tool with zero annotation coverage, this is a significant gap.

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 concise and front-loaded, stating the purpose in the first clause. It efficiently lists filtering options in a single sentence without unnecessary details. However, it could be slightly more structured by separating purpose from usage context.

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 a 'receipt ledger' contains, the return format, or behavioral aspects like safety and limitations. For a query tool with four parameters and no structured output documentation, more context is needed to guide effective use.

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 description adds minimal value beyond the input schema, which has 100% coverage. It lists filterable fields (time range, action, actor, decision) but doesn't provide additional semantics like format examples or constraints. Since the schema already documents all parameters thoroughly, the baseline score of 3 is appropriate.

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: 'Query the receipt ledger for audit or compliance reporting.' It specifies the verb (query) and resource (receipt ledger) with a clear use case (audit/compliance reporting). However, it doesn't explicitly differentiate from sibling tools like 'get_compliance_report' or 'verify_trustatom,' which might have overlapping audit/compliance functions.

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. It mentions filtering capabilities but doesn't specify prerequisites, exclusions, or compare it to sibling tools like 'get_compliance_report' for reporting or 'verify_trustatom' for verification tasks. This leaves the agent without clear usage context.

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/CWNApps/trustatom-mcp'

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