Skip to main content
Glama

Count matching events per craft

count_events_by_craft
Read-only

Count matching events per craft. How many events match a search, per top-level craft, for the 'Jump to a craft' chips. Takes the same filters as GET /api/events (q, type, tag, state, when or from+to, near or lat+lng, radius, free, online, inperson, tz) and counts with every one of them except craft, which is accepted and ignored, so each craft keeps its number while one is chosen. Child crafts count toward their top-level parent (needlepoint, cross-stitch and embroidery count as needlework), and an event counts once per top-level craft, so the crafts can add up to more than total, the distinct number of matching events. A craft's count equals the total GET /api/events reports for that craft=, with one known exception: with a text query (q), the typo-tolerant fallback applies only when a search has no exact text match, so it can apply to the all-crafts count but not to one craft's search (or the other way round) and the numbers can then differ. Only crafts with at least one match are listed, most first, then in taxonomy order. Location is never inferred from the caller's IP; a near that matches no US place is a 400. Answers 503 not_configured while the counts aren't available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNo
toNo
tzNo
latNo
lngNo
tagNo
freeNo
fromNo
nearNo
sortNo
typeNo
whenNo
craftNo
stateNo
onlineNo
radiusNo
inpersonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover the read-only safety profile; the description carries the real behavioral load. It discloses the craft-ignored semantics, child-craft roll-up, the fact that per-craft counts can exceed `total`, the one known discrepancy with craft=<slug> under typo-tolerant search, ordering rules, and explicit 400/503 failure modes.

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?

It is long, but the length is justified by genuine complexity and the information is front-loaded: purpose, then filter contract, then counting semantics, then errors. The opening sentence echoes the title, a small redundancy.

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

Completeness5/5

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

For a 17-parameter, no-output-schema aggregation tool, nothing essential is missing: filters, dedup/roll-up rules, ordering, total-vs-sum relationship, and error conditions are all covered. An agent could call and interpret this correctly without further sources.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does: it enumerates nearly every filter (q, type, tag, state, when or from+to, near or lat+lng, radius, free, online, inperson, tz) and explains the surprising behavior of `craft`. It omits `sort` and gives no value formats for the string params, so not quite a 5.

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?

States a specific verb ('count') and resource ('matching events per craft') plus the display purpose ('Jump to a craft' chips). This clearly distinguishes it from the sibling count_events_by_state, which does the same aggregation on a different axis.

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?

The description scopes usage well: it is for chip counts and takes the same filters as GET /api/events, and it explains the craft filter is swallowed rather than applied. It never explicitly names a sibling alternative or a 'use X instead when Y' rule, so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources