Skip to main content
Glama

hub_context

Resolve which hub project your working directory belongs to, using marker files, sync paths, or folder names. Returns project digest, journal tail, handoffs, and live presence.

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, laws, digestAgeDays, digestStale?, openTasks, activeClaims, journalTail, handoffs, presenceHere, claimsTouched}, the fields that change least first. 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; handoffs are the project's "## Handoff " sections as {agent, at, ageHours, text}, yours first and whole (own:true), then the newest 6 of the others cut to 600 chars (cut: the whole length). project is null with a hint if nothing matched.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cwd": "<cwd>"
    },
    "name": "hub_context"
  }
}

Input 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
handoffsNohow many other agents' handoffs to include, newest first, default 6
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. Changed1 schema field changedv0.9.88
    • addedInput schema / properties / handoffs
      Added value: +{
      +  "description": "how many other agents' handoffs to include, newest first, default 6",
      +  "type": "integer"
      +}
  2. 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"
      +}
  3. Addedv0.5.0

TDQS

A4.5/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 does so: it discloses the fallback chain and its failure mode (`guessed:true` plus a one-line fix in `hint`), and the null-project-with-hint outcome. It also explains derived semantics beyond the raw call — that `digestStale` can report "current" for a digest months behind its journal, that `presenceHere` means live heartbeats under this root, and that `handoffs` truncate others to 600 chars while the caller's own is whole (`own:true`, with `cut` giving the full length).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded correctly — usage trigger first, then the resolution hierarchy, then the return shape — but the single unbroken block with a long `{...}` field enumeration and mid-sentence em-dash asides is heavy to parse. Given there is no output schema, the field list earns its place, yet the structure could be split so the field inventory does not bury the calling instructions.

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?

There is no output schema and no annotations, so the description must handle both roles — and it does, naming every returned field and the ordering rationale ("the fields that change least first") plus the meaning of the conditional and truncated variants. An agent can call this correctly and read the result without any other source.

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 100%, so the baseline is 3; the description earns an extra point by explaining what parameters affect downstream — `agent` excludes your own claims from `claimsTouched`, and `staleDays` follows the same rule as `hub_status`. It also restates key defaults (6 handoffs, 5 journal entries) and the fact that `cwd` is caller-supplied because the server serves many directories, though the schema already says much of this.

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?

The description opens with a plain-language framing ("Where am I") and then states the concrete operation: resolving which hub project the caller's working directory belongs to. The resolution order is enumerated (`.hubd` marker, project card sync path, folder-name guess), so the agent can tell exactly what this tool does and how reliable the answer is.

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 usage trigger is stated explicitly and unusually well: "the first call of a session and the first call after a context compaction." It also ties `digestStale` to the same rule `hub_status` uses, orienting the agent relative to that sibling. What it lacks is a when-not-to-use note — e.g. that subsequent lookups within a session need not repeat this call.

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