> ## Documentation Index
> Fetch the complete documentation index at: https://hubify.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Tools Reference

> All 48 Hubify MCP tools. Platform tools (unprefixed) drive lab data directly. Phase E ledger tools (hubify_* prefix) write to the agentEvents ledger and appear in the Hubify web app in real time.

# MCP Tools Reference

The Hubify MCP server exposes **48 tools** across two categories:

| Category             | Count | Prefix    | Use for                                                     |
| -------------------- | ----- | --------- | ----------------------------------------------------------- |
| Platform tools       | 31    | none      | Reading and writing lab data directly                       |
| Phase E ledger tools | 17    | `hubify_` | Writing to the agentEvents ledger; surfaces in Captain View |

All tools work without authentication for both read and write operations when the MCP server is configured with `CONVEX_URL` and `HUBIFY_LAB_SLUG`.

***

## Platform Tools

### Lab Navigation

#### `lab_create`

Create a new lab and automatically provision a matching GitHub repository. If the user has a connected GitHub account, the repo is created in their own account. Otherwise it is created in the `Hubify-Projects` org.

| Parameter     | Type    | Required | Description                                         |
| ------------- | ------- | -------- | --------------------------------------------------- |
| `userId`      | string  | Yes      | Convex user ID                                      |
| `name`        | string  | Yes      | Lab name (used as repo name base)                   |
| `description` | string  | No       | Short description                                   |
| `mission`     | string  | No       | Mission statement                                   |
| `subdomain`   | string  | No       | URL subdomain (auto-derived from name if omitted)   |
| `isPublic`    | boolean | No       | Whether the lab and repo are public (default: true) |

Returns: `{ labId, repoUrl }` — `repoUrl` is `null` if GitHub repo creation failed (lab is still created).

***

#### `lab_status`

Get a snapshot of the current lab: experiment count, paper count, agent count, pod count, anomaly count.

No parameters.

***

#### `lab_list`

List every lab on this Convex deployment with slug, name, status, and which is currently active.

No parameters.

***

#### `lab_switch`

Hot-swap the active lab for the current MCP session without restarting.

| Parameter | Type   | Required | Description                                                         |
| --------- | ------ | -------- | ------------------------------------------------------------------- |
| `slug`    | string | No       | Lab slug to switch to. Omit to reset to the env-configured default. |

***

### Experiments

#### `experiment_list`

List experiments with status, title, and runtime.

| Parameter | Type   | Required | Description                                            |
| --------- | ------ | -------- | ------------------------------------------------------ |
| `status`  | string | No       | Filter: `queued`, `running`, `pass`, `fail`, `blocked` |

***

#### `experiment_create`

Create and queue a new experiment (auto-generates `EXP-NNN` ID).

| Parameter     | Type   | Required | Description                                    |
| ------------- | ------ | -------- | ---------------------------------------------- |
| `title`       | string | Yes      | Experiment title                               |
| `config`      | string | No       | JSON config string (hyperparameters, etc.)     |
| `template`    | string | No       | Template name to base the experiment on        |
| `computeMode` | string | No       | `gpu`, `cpu`, or `distributed`. Default: `gpu` |

***

#### `experiment_run`

Dispatch a queued experiment to a GPU pod. Accepts `EXP-*` ID or Convex document `_id`.

| Parameter      | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| `experimentId` | string | Yes      | `EXP-BB-001` or Convex `_id`                        |
| `podId`        | string | No       | Target pod ID. Auto-picks a running pod if omitted. |

***

#### `experiment_queue`

List queued and running experiments.

No parameters.

***

### Papers

#### `paper_list`

List all papers with readiness percentages and status.

No parameters.

***

#### `paper_create`

Create a new paper draft.

| Parameter  | Type   | Required | Description                                                   |
| ---------- | ------ | -------- | ------------------------------------------------------------- |
| `title`    | string | Yes      | Paper title                                                   |
| `abstract` | string | No       | Paper abstract                                                |
| `target`   | string | No       | Target journal (e.g. `Physical Review D`, `MNRAS`)            |
| `status`   | string | No       | `draft`, `review`, `submitted`, `published`. Default: `draft` |

***

#### `paper_review`

Trigger a cross-model peer review on a paper via the orchestrator.

| Parameter   | Type   | Required | Description         |
| ----------- | ------ | -------- | ------------------- |
| `paperName` | string | Yes      | Paper name or title |

***

### Tasks

#### `task_list`

List tasks with status and priority.

| Parameter | Type   | Required | Description                                                |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `status`  | string | No       | Filter: `backlog`, `todo`, `in_progress`, `review`, `done` |

***

#### `task_create`

Create a new task.

| Parameter     | Type   | Required | Description                                          |
| ------------- | ------ | -------- | ---------------------------------------------------- |
| `title`       | string | Yes      | Task title                                           |
| `description` | string | No       | Task details                                         |
| `priority`    | string | No       | `low`, `medium`, `high`, `urgent`. Default: `medium` |
| `status`      | string | No       | Initial status. Default: `todo`                      |

***

#### `task_update`

Update task status or priority.

| Parameter  | Type   | Required | Description       |
| ---------- | ------ | -------- | ----------------- |
| `taskId`   | string | Yes      | Convex task `_id` |
| `status`   | string | No       | New status        |
| `priority` | string | No       | New priority      |

***

### Memory & Knowledge

#### `memory_search`

Search across all 4 memory layers: user messages, agent learnings, knowledge wiki, and lab decisions.

| Parameter | Type   | Required | Description                                                   |
| --------- | ------ | -------- | ------------------------------------------------------------- |
| `query`   | string | Yes      | Search query                                                  |
| `layer`   | string | No       | `user`, `agent`, `lab`, `decisions`, or `all`. Default: `all` |

***

#### `memory_save`

Save to the lab memory system.

| Parameter   | Type   | Required    | Description                            |
| ----------- | ------ | ----------- | -------------------------------------- |
| `type`      | string | Yes         | `preference`, `decision`, or `message` |
| `key`       | string | Conditional | Required for `preference` type         |
| `value`     | string | Conditional | Required for `preference` type         |
| `title`     | string | Conditional | Required for `decision` type           |
| `decision`  | string | Conditional | Required for `decision` type           |
| `rationale` | string | Conditional | Required for `decision` type           |
| `content`   | string | Conditional | Required for `message` type            |
| `summary`   | string | No          | One-line summary for `message` type    |

***

#### `knowledge_search`

Full-text search across the lab's knowledge base: experiments, papers, agents, surveys, knowledge entries.

| Parameter | Type   | Required | Description  |
| --------- | ------ | -------- | ------------ |
| `query`   | string | Yes      | Search query |

***

#### `knowledge_add`

Add an entry to the lab's knowledge wiki.

| Parameter         | Type      | Required | Description                                                     |
| ----------------- | --------- | -------- | --------------------------------------------------------------- |
| `name`            | string    | Yes      | Entry name (e.g. `Hellings-Downs Correlation`)                  |
| `entityType`      | string    | Yes      | `concept`, `entity`, `source`, `method`, `result`, or `dataset` |
| `description`     | string    | No       | Entry description                                               |
| `relatedEntities` | string\[] | No       | Related entity names                                            |

***

#### `agent_learning_save`

Save an operational or scientific learning to agent memory.

| Parameter    | Type   | Required | Description                                                       |
| ------------ | ------ | -------- | ----------------------------------------------------------------- |
| `key`        | string | Yes      | Short unique key (e.g. `mcmc-convergence-criteria`)               |
| `insight`    | string | Yes      | What was learned — specific and actionable                        |
| `type`       | string | No       | `operational`, `scientific`, `procedural`. Default: `operational` |
| `confidence` | number | No       | Confidence 0–1. Default: 0.7                                      |

***

### Contributions

#### `contribution_list`

List scientific contributions with novelty scores.

| Parameter | Type   | Required | Description              |
| --------- | ------ | -------- | ------------------------ |
| `limit`   | number | No       | Max results. Default: 20 |

***

#### `contribution_create`

Log a scientific contribution.

| Parameter     | Type   | Required | Description                                                                                           |
| ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------- |
| `title`       | string | Yes      | Contribution title                                                                                    |
| `description` | string | Yes      | What was discovered or contributed                                                                    |
| `type`        | string | No       | `prediction`, `measurement`, `method`, `catalog`, `constraint`, `null_result`. Default: `measurement` |

***

### Agents & Communication

#### `agent_list`

List all agents with roles, status, and models.

No parameters.

***

#### `chat`

Send a message to the lab orchestrator and wait for its response. Shares history with the web chat and CLI surfaces.

| Parameter   | Type   | Required | Description                                                 |
| ----------- | ------ | -------- | ----------------------------------------------------------- |
| `message`   | string | Yes      | Message to send                                             |
| `sessionId` | string | No       | Existing session ID to resume. Pass `"new"` to start fresh. |
| `waitMs`    | number | No       | Max wait for response in ms. Default: 90000                 |

***

### Compute & Costs

#### `pod_list`

List GPU pods with status, GPU type, and cost.

No parameters.

***

#### `pod_create`

Create a new GPU pod via RunPod API.

| Parameter | Type   | Required | Description                                             |
| --------- | ------ | -------- | ------------------------------------------------------- |
| `gpuType` | string | No       | GPU type (e.g. `H200`, `H100`, `A100`). Default: `H100` |
| `name`    | string | No       | Pod name                                                |

***

#### `cost_summary`

Get daily/weekly/monthly/all-time cost breakdown vs budget.

No parameters.

***

### Misc

#### `notification_list`

List recent notifications (alerts, experiment completions, agent messages).

| Parameter    | Type    | Required | Description                               |
| ------------ | ------- | -------- | ----------------------------------------- |
| `limit`      | number  | No       | Max results. Default: 20                  |
| `unreadOnly` | boolean | No       | Only unread notifications. Default: false |

***

#### `survey_list`

List astronomical surveys with anomaly counts and source statistics.

No parameters.

***

#### `figure_list`

List all figures with titles, types, and image URLs.

| Parameter | Type   | Required | Description              |
| --------- | ------ | -------- | ------------------------ |
| `limit`   | number | No       | Max results. Default: 20 |

***

#### `standup_trigger`

Trigger an agent standup.

| Parameter | Type   | Required | Description                                        |
| --------- | ------ | -------- | -------------------------------------------------- |
| `type`    | string | No       | `morning`, `midday`, `evening`. Default: `morning` |

***

#### `activity_list`

List recent lab activity (experiment completions, agent actions, alerts).

| Parameter | Type   | Required | Description              |
| --------- | ------ | -------- | ------------------------ |
| `limit`   | number | No       | Max results. Default: 20 |

***

## Phase E Ledger Tools (`hubify_*`)

These tools write to the `agentEvents` ledger. Events appear in real time in the Hubify web app's Captain View and activity feed. Use these when Claude Code is acting as a local lab operator.

### Context & Session

#### `hubify_get_context`

Full lab snapshot as structured JSON: lab metadata, stats, recent events, contributions, papers. Use at session start.

| Parameter     | Type   | Required | Description                           |
| ------------- | ------ | -------- | ------------------------------------- |
| `recentLimit` | number | No       | Recent events to include. Default: 25 |

***

#### `hubify_get_context_pack`

Token-budgeted plain-text context pack for agent system prompts (lab state + in-flight experiments + recent events).

| Parameter  | Type   | Required | Description                                                        |
| ---------- | ------ | -------- | ------------------------------------------------------------------ |
| `target`   | string | No       | Compaction style: `claude`, `codex`, `generic`. Default: `generic` |
| `maxBytes` | number | No       | Approximate output cap. Default: 8000                              |

***

#### `hubify_create_session_summary`

Persist a session summary to the ledger. Use at the end of every Claude Code session.

| Parameter    | Type   | Required | Description                                            |
| ------------ | ------ | -------- | ------------------------------------------------------ |
| `summary`    | string | Yes      | Markdown or plain-text summary of what was done        |
| `sessionId`  | string | No       | Session identifier. Auto-generates a UUID if omitted.  |
| `durationMs` | number | No       | Session duration in ms                                 |
| `surface`    | string | No       | Where the session ran: `claude-code`, `cli`, `sidebar` |

***

### Event Logging

#### `hubify_log_event`

Append a typed event to the agentEvents ledger. Idempotent on `clientEventId`.

Common event types: `paper.section.drafted`, `experiment.completed`, `discovery.proposed`, `run.recorded`, `agent.woke`, `agent.sleeping`.

| Parameter       | Type   | Required | Description                                                                           |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------- |
| `type`          | string | Yes      | Dotted event type (e.g. `paper.section.drafted`)                                      |
| `clientEventId` | string | No       | Idempotency key. Auto-generated if omitted.                                           |
| `actorKind`     | string | No       | `captain`, `agent`, `orchestrator`, `system`, `webhook`, `cli`, `mcp`. Default: `mcp` |
| `actorLabel`    | string | No       | Human-readable actor name (e.g. `claude-code`)                                        |
| `entityType`    | string | No       | Entity the event is about (`paper`, `experiment`, `claim`)                            |
| `entityId`      | string | No       | Convex `_id` or external ID of the entity                                             |
| `payload`       | object | No       | JSON-encodable body                                                                   |
| `severity`      | string | No       | `debug`, `info`, `warn`, `error`. Default: `info`                                     |
| `correlationId` | string | No       | Links related events together                                                         |
| `parentEventId` | string | No       | Parent event for nested flows                                                         |

***

#### `hubify_log_finding`

Log a scientific finding. When `noveltyScore >= 6`, also creates a contributions row visible in the Contributions UI.

| Parameter      | Type      | Required | Description                                                 |
| -------------- | --------- | -------- | ----------------------------------------------------------- |
| `summary`      | string    | Yes      | One-paragraph summary of the finding                        |
| `noveltyScore` | number    | No       | 1–10 novelty rating. Default: 5                             |
| `claimIds`     | string\[] | No       | Related claim IDs                                           |
| `experimentId` | string    | No       | Source experiment Convex `_id`                              |
| `type`         | string    | No       | `method`, `dataset`, `result`, `theorem`. Default: `result` |

***

#### `hubify_sync_events`

Batch-flush locally-buffered events in one round-trip. Idempotent on `clientEventId`.

| Parameter | Type      | Required | Description                                                           |
| --------- | --------- | -------- | --------------------------------------------------------------------- |
| `events`  | object\[] | Yes      | Array of event objects, each with `type` and `clientEventId` required |

Each event in the array accepts: `type`, `clientEventId`, `actorKind`, `actorLabel`, `entityType`, `entityId`, `payload`, `severity`, `correlationId`, `occurredAt`.

***

### Run & Claims

#### `hubify_record_run`

Record a new run directory, tying paths to the originating experiment. Emits `run.recorded`.

| Parameter      | Type      | Required | Description                            |
| -------------- | --------- | -------- | -------------------------------------- |
| `runId`        | string    | Yes      | Run ID, e.g. `2026-04-29-mcmc-final`   |
| `paths`        | string\[] | Yes      | Files written (relative to repo root)  |
| `experimentId` | string    | No       | Source experiment `_id`                |
| `summary`      | string    | No       | Brief summary of what the run produced |

***

#### `hubify_create_claim`

Create a scientific claim. Emits `claim.proposed` and creates a contributions row.

| Parameter      | Type   | Required | Description                           |
| -------------- | ------ | -------- | ------------------------------------- |
| `text`         | string | Yes      | The claim — one falsifiable assertion |
| `paperId`      | string | No       | Paper this claim belongs to           |
| `experimentId` | string | No       | Source experiment `_id`               |
| `noveltyScore` | number | No       | 1–10. Default: 5                      |

***

#### `hubify_update_claim`

Update a claim's status. Emits `claim.upserted`, `claim.supported`, or `claim.refuted`.

| Parameter      | Type      | Required | Description                      |
| -------------- | --------- | -------- | -------------------------------- |
| `claimId`      | string    | Yes      | Claim contribution `_id`         |
| `action`       | string    | Yes      | `upsert`, `support`, or `refute` |
| `text`         | string    | No       | New claim text (for `upsert`)    |
| `evidenceIds`  | string\[] | No       | Evidence IDs (for `support`)     |
| `refuterIds`   | string\[] | No       | Refuting IDs (for `refute`)      |
| `noveltyScore` | number    | No       | Updated novelty score            |

***

### Status

#### `hubify_compute_status`

Current pod and compute status, cost totals, monthly budget, and budget headroom.

No parameters.

***

#### `hubify_repo_status`

Lab GitHub repo wiring: URL, default branch, manifest schema version, auto-push state.

No parameters.

***

### Paper Pipeline

#### `hubify_get_paper_pipeline_status`

Return pipeline state for a paper: title, status, readiness %, target venue, last-updated.

| Parameter | Type   | Required | Description        |
| --------- | ------ | -------- | ------------------ |
| `paperId` | string | Yes      | Paper Convex `_id` |

***

#### `hubify_update_paper_stage`

Move a paper to a new pipeline stage. Emits `paper.stage.changed` and updates the paper row.

| Parameter   | Type   | Required | Description                                                                           |
| ----------- | ------ | -------- | ------------------------------------------------------------------------------------- |
| `paperId`   | string | Yes      | Paper Convex `_id`                                                                    |
| `from`      | string | Yes      | Current stage (e.g. `drafting`)                                                       |
| `to`        | string | Yes      | Target stage (e.g. `internal-review`)                                                 |
| `newStatus` | string | No       | New top-level status if it should change: `draft`, `review`, `submitted`, `published` |

***

#### `hubify_update_paper_section`

Record that a paper section was drafted, edited, or completed. Emits `paper.section.drafted`, `paper.section.edited`, or `paper.section.completed`.

Note: does not write `.tex` content directly — the round-trip GitHub sync owns the file content.

| Parameter | Type   | Required | Description                                              |
| --------- | ------ | -------- | -------------------------------------------------------- |
| `paperId` | string | Yes      | Paper Convex `_id`                                       |
| `section` | string | Yes      | Section name (e.g. `introduction`, `methods`, `results`) |
| `action`  | string | Yes      | `draft`, `edit`, or `complete`                           |
| `sha`     | string | No       | Git commit sha if known                                  |
| `summary` | string | No       | Brief description of what changed                        |

***

### Adversarial Review

#### `hubify_start_adversarial_review`

Kick off a multi-model adversarial peer review for a paper. Emits `adversarial_review.started` and triggers parallel reviewer roles.

| Parameter  | Type      | Required | Description                                                                             |
| ---------- | --------- | -------- | --------------------------------------------------------------------------------------- |
| `paperId`  | string    | Yes      | Paper Convex `_id`                                                                      |
| `roles`    | string\[] | No       | Reviewer roles (e.g. `["skeptic", "statistician"]`). Backend defaults apply if omitted. |
| `abstract` | string    | No       | Override the stored abstract for this review round                                      |

***

#### `hubify_log_model_review`

Record one model's verdict in an in-flight adversarial review. Creates a paperReviews row visible in the reviews UI.

| Parameter       | Type      | Required | Description                                             |
| --------------- | --------- | -------- | ------------------------------------------------------- |
| `paperId`       | string    | Yes      | Paper Convex `_id`                                      |
| `role`          | string    | Yes      | Reviewer role (`skeptic`, `statistician`, `generalist`) |
| `model`         | string    | Yes      | Model identifier (e.g. `claude-opus-4-8`)               |
| `verdict`       | string    | Yes      | `approve`, `concern`, or `reject`                       |
| `summary`       | string    | Yes      | Review summary                                          |
| `findings`      | string\[] | No       | Specific findings                                       |
| `correlationId` | string    | No       | Correlation ID from `hubify_start_adversarial_review`   |

***

#### `hubify_create_review_consensus`

Synthesize an adversarial review verdict. Emits `consensus.created` and triggers the synthesis action.

| Parameter       | Type      | Required | Description                                           |
| --------------- | --------- | -------- | ----------------------------------------------------- |
| `paperId`       | string    | Yes      | Paper Convex `_id`                                    |
| `verdict`       | string    | Yes      | `approve`, `minor`, `major`, or `reject`              |
| `blockers`      | string\[] | No       | Blocking issues that must be resolved                 |
| `correlationId` | string    | No       | Correlation ID from `hubify_start_adversarial_review` |

***

## MCP Resources

In addition to tools, the MCP server exposes read-only resources:

| Resource URI        | Contents                                |
| ------------------- | --------------------------------------- |
| `lab://status`      | Lab stats as JSON                       |
| `lab://experiments` | All experiments as JSON                 |
| `lab://papers`      | All papers as JSON                      |
| `lab://agents`      | All agents as JSON                      |
| `lab://tasks`       | All tasks as JSON                       |
| `lab://memory`      | Lab decisions + agent learnings as JSON |

***

## MCP Prompts

Four built-in prompt templates available in any MCP client:

| Prompt                | Description                                         |
| --------------------- | --------------------------------------------------- |
| `research-assistant`  | Research assistant with full lab context injected   |
| `paper-reviewer`      | Rigorous peer reviewer for a specific paper         |
| `experiment-designer` | Designs next experiments based on completed results |
| `houston-method`      | Post-experiment 9-step Houston Method checklist     |
| `standup-facilitator` | Facilitates agent standups with real lab data       |
