Skip to main content
Glama
OpenCDR MCP

OpenCDR MCP

Official
by dbnz-io

opencdr_logs_search

Read-onlyIdempotent

Search audit and CloudTrail logs by service, event ID, or event name using exactly one selector; read-only, paginated results for incident investigation.

Instructions

Search audit/CloudTrail logs. Read-only.

Provide exactly ONE selector: service, event_id, or event_name (the backend serves each from a dedicated index and cannot AND-combine them). date_from/date_to (YYYY-MM-DD, UTC, inclusive, max 31-day range) apply ONLY to the service selector and default to the last 7 days; they are ignored for event_id/event_name. Paginated via next_token.

Correlating by source_ip / principal / access_key_id / user_agent / resource / account is not yet supported by the backend -- use event_id to pivot on a specific event.

In fleet mode, supply agent_id explicitly. Core mode leaves agent_id unset.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "opencdr_logs_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
orderNodesc
date_toNo
serviceNo
agent_idNo
event_idNo
date_fromNo
event_nameNo
next_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / agent_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Agent Id"
      +}
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, so the safety bar is met; the description still adds real behavior: dedicated indexes per selector, date filters silently ignored for event_id/event_name, a 31-day maximum range with a 7-day default, and cursor pagination via next_token. It does not describe result shape or ordering semantics, and the silent ignoring of date params is disclosed but not flagged as an error the caller should watch for.

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 read-only constraint is front-loaded, followed by the selector rule, then parameter caveats, then mode notes — a logical escalation for a caller reading top-down. Sentences are dense but every clause carries an operational constraint; nothing is filler.

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

Completeness4/5

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

For a 9-parameter, no-output-schema, open-world query tool the definition covers selection rules, temporal bounds, pagination, and environment modes, which is what an agent needs to invoke it correctly. The remaining omissions — meaning of limit/order and any hint about the fields a hit returns — are small but noticeable given no output schema exists to fill them.

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

Parameters5/5

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

With 9 parameters at 0% schema description coverage, the description carries the full burden and largely does: it defines the mutual exclusivity of service/event_id/event_name, the YYYY-MM-DD UTC inclusive format and applicability limits of date_from/date_to, the pagination role of next_token, and the fleet/core distinction for agent_id. Only limit and order are left to the schema's bare defaults/enum, a minor residual gap.

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?

Opens with a specific verb and resource ("Search audit/CloudTrail logs") plus the read-only scope, which is unambiguous for an agent. It does not name or differentiate against sibling tools such as opencdr_signals_search or opencdr_detections_query, so the agent must infer which search surface is appropriate.

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

Usage Guidelines5/5

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

Explicitly states the when-to-use contract: provide exactly ONE of service, event_id, or event_name, and explains why the backend cannot AND-combine them. It also sets negative guidance (source_ip/principal/access_key_id/user_agent/resource/account correlation is unsupported; pivot via event_id instead) and mode-specific guidance (fleet mode requires agent_id, core mode leaves it unset).

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