Skip to main content
Glama

Count events

count_events
Read-onlyIdempotent

Count matching Nostr events by filter via NIP-45 COUNT without downloading them; report when a relay lacks COUNT support.

Instructions

Counts the events matching a filter using NIP-45 COUNT, without downloading them. Reports clearly when the relay does not support COUNT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNoFilter by single-letter tags, e.g. {"e": ["<event id>"]} for events that reference an event, {"p": ["<pubkey>"]} for mentions, {"t": ["bitcoin"]} for hashtags. e and p take 64-hex values.
kindsNoOnly these event kinds (e.g. [1] for notes, [7] reactions).
relayNoRelay URL (wss://…). It must be one of the configured relays; default: the first one. See nostrclaw_status.
relaysNoSeveral relays (each must be configured): the same question goes to all of them and the answers are merged without duplicates; the result says what each relay returned. Overrides `relay`.
authorsNo
sinceHoursNoOnly events newer than this many hours.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.14.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/openWorld/non-destructive, so safety is covered; the description adds real behavioral context beyond them — the NIP-45 mechanism and explicit fallback messaging when a relay lacks COUNT support, which the agent would otherwise have to discover at runtime.

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?

Two sentences, zero filler, with the core action front-loaded and the protocol/fallback caveat immediately after. Every clause earns its place.

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?

With strong annotations and a well-documented 6-parameter schema, the description supplies the missing pieces an agent needs: the counting mechanism and the unsupported-relay behavior. The only minor gap is not hinting at the shape of the returned count/merged-relay result, which is largely self-evident for a count tool.

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 83%, so most parameters (tags, kinds, relay/relays, sinceHours) already carry their own documentation with examples; authors is the only one left bare. The description adds no filter syntax or constraint detail beyond what the schema states, so baseline 3 applies.

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?

Specific verb (counts) + resource (events matching a filter) with a distinguishing trait: it uses NIP-45 COUNT and does not download events, which separates it from fetch-oriented siblings like recent_events or relay_overview. It never names a sibling explicitly, so differentiation is inferable rather than stated.

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 phrase 'without downloading them' implies when to prefer this over retrieval tools, but no alternative tool is named and no when-not condition or prerequisite (e.g. needing a configured relay) is spelled out in the description. Usage is implied rather than instructed.

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