Skip to main content
Glama
PiQrypt

PiQrypt MCP Server

piqrypt_search_events

Search agent cryptographic event history by type, time range, or session to reconstruct actions with signed events and chain metadata.

Instructions

Search the agent's cryptographic event history by type, time range, or session. Returns signed events with chain metadata. Use to reconstruct what an agent did during a specific period.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_typeNoFilter by event type (e.g., "trade_executed", "decision_made")
from_timestampNoStart timestamp (Unix UTC seconds)
to_timestampNoEnd timestamp (Unix UTC seconds)
limitNoMaximum number of results

Implementation Reference

  • The actual handler function 'search_events' that executes the search by calling aiss.search_events() with the agent_id/participant, event_type, from_timestamp, to_timestamp, and limit parameters.
    def search_events(params: Dict[str, Any]) -> Dict[str, Any]:
        """
        Search events using AISS index.
    
        Args:
            params: dict with optional agent_name (or agent_id),
                    event_type, from_timestamp, to_timestamp, limit
    
        Returns:
            dict with events list, count, vigil_url
        """
        participant = params.get("agent_name", params.get("agent_id"))
        results = aiss.search_events(
            participant=participant,
            event_type=params.get("event_type"),
            after=params.get("from_timestamp"),
            before=params.get("to_timestamp"),
            limit=params.get("limit", 50),
        )
        return {
            "events": results,
            "count": len(results),
            "vigil_url": VIGIL_URL,
        }
  • The TypeScript handler in the switch/case that routes 'piqrypt_search_events' to callPythonBridge('search', ...) with params extracted from args.
    case 'piqrypt_search_events':
      result = callPythonBridge('search', {
        event_type: args.event_type,
        from_timestamp: args.from_timestamp,
        to_timestamp: args.to_timestamp,
        limit: args.limit || 100,
      });
      break;
  • src/index.ts:131-156 (registration)
    Tool registration: defines the tool name 'piqrypt_search_events', description, and input schema with event_type, from_timestamp, to_timestamp, and limit properties.
    {
      name: 'piqrypt_search_events',
      description: 'Search the agent\'s cryptographic event history by type, time range, or session. Returns signed events with chain metadata. Use to reconstruct what an agent did during a specific period.',
      inputSchema: {
        type: 'object',
        properties: {
          event_type: {
            type: 'string',
            description: 'Filter by event type (e.g., "trade_executed", "decision_made")',
          },
          from_timestamp: {
            type: 'number',
            description: 'Start timestamp (Unix UTC seconds)',
          },
          to_timestamp: {
            type: 'number',
            description: 'End timestamp (Unix UTC seconds)',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results',
            default: 100,
          },
        },
      },
    },
  • Input schema for piqrypt_search_events: defines event_type (string), from_timestamp (number), to_timestamp (number), and limit (number, default 100) as optional filter parameters.
    {
      name: 'piqrypt_search_events',
      description: 'Search the agent\'s cryptographic event history by type, time range, or session. Returns signed events with chain metadata. Use to reconstruct what an agent did during a specific period.',
      inputSchema: {
        type: 'object',
        properties: {
          event_type: {
            type: 'string',
            description: 'Filter by event type (e.g., "trade_executed", "decision_made")',
          },
          from_timestamp: {
            type: 'number',
            description: 'Start timestamp (Unix UTC seconds)',
          },
          to_timestamp: {
            type: 'number',
            description: 'End timestamp (Unix UTC seconds)',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of results',
            default: 100,
          },
        },
      },
    },
  • Helper function 'callPythonBridge' that spawns a Python subprocess to execute the bridge commands (including 'search') with params passed as JSON.
    function callPythonBridge(command: string, params: any): any {
      const pythonCmd = process.env.PIQRYPT_PYTHON
        || (process.platform === 'win32' ? 'python' : 'python3');
    
      const result = spawnSync(
        pythonCmd,
        [PYTHON_BRIDGE, command, JSON.stringify(params)],
        { encoding: 'utf-8', timeout: 30000 }
      );
    
      if (result.error) throw new Error(`PiQrypt bridge spawn error: ${result.error.message}`);
      if (result.status !== 0) throw new Error(`PiQrypt bridge error: ${result.stderr}`);
    
      const stdout = result.stdout;
      const jsonStart = stdout.indexOf('{');
      if (jsonStart === -1) throw new Error(`No JSON in bridge output: ${stdout}`);
      return JSON.parse(stdout.slice(jsonStart));
    }
Behavior3/5

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

No annotations provided; description states it returns signed events with chain metadata, implying read-only. However, it does not mention authentication, rate limits, pagination behavior, or what happens with empty results.

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?

Three concise sentences with no filler. The action verb is front-loaded, and every sentence adds useful context.

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?

No output schema; description gives a brief idea of return values (signed events with chain metadata) but omits details like event structure or metadata fields. The mention of session without a corresponding parameter reduces completeness.

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 coverage is 100%, so the description adds minimal value beyond repeating filter options. It mentions session but the schema lacks a session parameter, creating slight ambiguity.

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

Purpose5/5

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

Clearly states verb (search), resource (cryptographic event history), and scope (by type, time range, or session). Distinguishes from siblings like piqrypt_stamp_event (create) and piqrypt_export_audit (export).

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

Usage Guidelines4/5

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

Provides a clear use case ('reconstruct what an agent did during a specific period'), but does not explicitly state when not to use or mention alternatives among siblings.

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/PiQrypt/piqrypt-mcp-server'

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