Skip to content

Queries

WarmHub provides several query patterns for reading data. Each is optimized for a different access pattern.

QueryUse caseCLIMCP Tool
HEADSnapshot of all active entitieswh thing headwarmhub_thing_head
CountCount matching items without fetching datawh thing head --countwarmhub_thing_head with count: true
GetFetch a specific thing by wrefwh thing viewwarmhub_thing_get
QueryFilter by shape, kind, aboutwh thing querywarmhub_thing_query
AboutAssertions about a thingwh assertion listwarmhub_thing_about
HistoryVersion history of a thingwh thing historywarmhub_thing_history
ResolveResolve wref to identitywh thing resolvewarmhub_wref_resolve
SearchFind things by text contentwh thing searchwarmhub_thing_search
Get ManyBatch lookup by wrefswarmhub_thing_get_many
RefsBacklinks and cross-referenceswh thing refswarmhub_thing_refs

Starting fresh? Use warmhub_thing_head or wh thing head to get a broad overview of the repo’s current state. This is the fastest way to orient.

Counting items? Add --count to wh thing head or wh thing query (CLI), or pass count: true to the MCP tools. Returns { count: N } without transferring item data. Also available via GET /count in the HTTP API.

Know what you need? Use warmhub_thing_query or wh thing query with shape/kind/about filters for targeted retrieval.

Looking up one thing? Use warmhub_thing_get or wh thing view with the exact wref.

Searching by content? Use warmhub_thing_search or wh thing search with a text query. Supports full-text, semantic vector, and hybrid search modes.

Tracing history? Use warmhub_thing_history or wh thing history to see all versions.

When querying with --about, results only include assertions that directly target the specified thing. To also surface assertions about collections (Pair, Triple, Set, List) containing the thing, pass --resolve-collections:

  • CLI: --resolve-collections (supported by thing query, thing history, thing search text mode, assertion list)
  • MCP: resolveCollections: true (supported by warmhub_thing_query, warmhub_thing_history, warmhub_thing_about, and warmhub_thing_search in text mode only)
  • HTTP: ?resolveCollections=true (supported by /query, /history, /about)

See Collection Resolution for details and examples.

By default, HEAD, query, and about return active entities only. History is different: it always returns all versions (including deactivations), but refuses to resolve a deactivated shape or about target unless includeInactive is set. To allow resolving deactivated targets, pass includeInactive where supported:

  • CLI: --include-inactive (supported by thing history, thing query, assertion list)
  • MCP: includeInactive: true (supported by warmhub_thing_history, warmhub_thing_query, warmhub_thing_about)
  • HTTP: ?includeInactive=true (supported by /history, /query, /about)

Check individual command/endpoint docs for availability — not all queries support this flag.

Count queries (--count / count: true / GET /count) return only the total instead of item data. Filter support varies by interface:

  • wh thing head --count / warmhub_thing_head with count: true — supports shape, kind, match
  • wh thing query --count / warmhub_thing_query with count: true — adds about and resolveCollections
  • GET /count — supports all filters: shape, kind, match, about, includeInactive, resolveCollections

Workspace-scoped counts are not yet supported on any interface.

WarmHub queries are available through three interfaces, but support varies by query type:

  • CLI: wh <domain> <verb> [args] [--flags] — human-readable output, or --json for structured data
  • MCP: warmhub_* tools — typed JSON-RPC tool calls
  • HTTP API: GET /api/repos/:org/:repo/<endpoint> — RESTful queries with query parameters