Skip to main content
Glama

hub_context

Resolve which hub project your working directory belongs to, returning project state, tasks, and presence to resume after context compaction.

Instructions

Where am I — the first call of a session and the first call after a context compaction. Resolves which hub project YOUR working directory belongs to, most to least certain: a .hubd marker file (repo root, first line = project slug) · a project card's recorded sync path · the repo folder name as a last-resort guess (guessed:true, with the one-line fix in hint). Returns {project, via, root, guessed, digest, digestSetAt, digestSetBy, digestAgeDays, digestStale?, openTasks, activeClaims, presenceHere, journalTail}. digestStale is the same verdict hub_status gives — a digest can be four months behind its own journal and still read as current; presenceHere lists live heartbeats whose cwd is under this root — who else is editing this checkout right now; journalTail is the last few entries of the project, so resuming reads state, not a summary. project is null with a hint if nothing matched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute path to YOUR OWN current working directory — this cannot be inferred by the server (it may serve many agents in many directories), so pass it explicitly.
agentNoyou — so `claimsTouched` (live claims whose glob covers a file changed here in the last recentMinutes) leaves your own claims out
staleDaysNodigest counts as stale after N days of journal it does not reflect (same rule as hub_status), default 7
journalTailNohow many recent journal entries of the project to include, default 5
recentMinutesNowindow for claimsTouched, default 30

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.9.15
    • addedInput schema / properties / agent
      Added value: +{
      +  "description": "you — so `claimsTouched` (live claims whose glob covers a file changed here in the last recentMinutes) leaves your own claims out",
      +  "type": "string"
      +}
    • addedInput schema / properties / journalTail
      Added value: +{
      +  "description": "how many recent journal entries of the project to include, default 5",
      +  "type": "integer"
      +}
    • addedInput schema / properties / recentMinutes
      Added value: +{
      +  "description": "window for claimsTouched, default 30",
      +  "type": "integer"
      +}
    • addedInput schema / properties / staleDays
      Added value: +{
      +  "description": "digest counts as stale after N days of journal it does not reflect (same rule as hub_status), default 7",
      +  "type": "integer"
      +}
  2. Addedv0.5.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations the description carries the full burden and delivers: it discloses the three-tier resolution order (marker file, project card path, folder-name guess with guessed:true), the failure mode (project null + hint), and a subtle caveat that digestStale can read current while being months behind. This is deep behavioral context beyond anything structured.

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?

Front-loads the core purpose and every clause earns its place by describing resolution order, return fields, and caveats. It is dense and slightly run-on with heavy em-dash usage, but not padded.

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?

No output schema exists, so the description must explain the return — and it enumerates every field (project, via, root, guessed, digest, openTasks, presenceHere, journalTail) with meaning. For a read-only session-bootstrap call, nothing an agent needs is missing.

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 already 100%, so the schema documents all five parameters (including why cwd cannot be inferred). The description reinforces a few meanings (journalTail content, staleDays rule) but adds little the schema does not already carry — the 3 baseline is appropriate.

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 and resource ('Resolves which hub project YOUR working directory belongs to') and frames the scope as 'Where am I' for session start. It is clearly distinct from siblings like hub_get/hub_status, even naming hub_status as the source of the same stale verdict.

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?

Explicitly tells the agent when to call it: 'the first call of a session and the first call after a context compaction.' That is a strong usage trigger, though it stops short of naming an alternative tool to use instead in other situations.

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