Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

MCP: Shared Job Context

MCP tools and automatic initialize guidance for safe live-job management across OpenTrain agents and employer team members.

The OpenTrain MCP server automatically includes the Shared Job Context protocol in its initialize response. Any compatible agent learns to read shared state before managing an existing job, claim coordinated work, recheck canonical records before consequential writes, use version and replay guards, and leave a checkpoint or handoff.

No separate skill, prompt, environment flag, or account rollout is required.

ToolPurpose
opentrain_get_job_contextRequired entry point: coherent objective, workflow, readiness, bounded fresh-priority queue, evaluator health, effective-policy summary, guide digest, blockers, actions, inconsistencies, and versions. Full view also includes bounded recent-event detail.
opentrain_get_job_context_deltaPaginated events after a prior context revision.
opentrain_get_job_context_personOne person’s lifecycle, raw and operative gates, blockers, decisions, and privacy-safe evidence IDs.
opentrain_sweep_job_contextReconcile durable event hints and canonical projection drift, then return the resulting revision and completeness.

Call opentrain_get_job_context before deciding or acting on an existing job. In a writable session, call opentrain_sweep_job_context with that revision. While hasMore is true, continue with each sweep response’s contextRevision; when false, fetch context again. Read-only sessions do not sweep.

MCP 0.11.0 carries one private server-issued session credential and bounded per-job delivery tokens across every covered native or bridged tool call. The hosted server isolates this state by authenticated principal and MCP transport session. The stdio server isolates it inside the current process. Raw credentials and signed tokens are captured internally and removed from model-visible content and structured results.

Every covered tool result includes sync and syncCoverage. Before acting, inspect:

  • sync.conflicts for overlapping claims, intents, policies, or newer work;
  • sync.recommendations for evidence-backed product-discovery suggestions;
  • sync.nextOperations for the exact safe next tools; and
  • sync.resyncRequired, which requires a fresh context read before a write.

syncCoverage.coverage is native, bridged, or none. A none result names the reason and does not claim that shared context was refreshed.

Use opentrain_poll_job_context_sync for one bounded real-time wait. A new delivery helps the agent choose what to investigate; it does not replace the canonical pre-action check.

While a job’s operating brief, typed workflow, or applicable required choice is missing, every covered result includes recommendation.job_setup_incomplete. Bootstrap next operations start with opentrain_get_job_setup, so the agent can discover and drive setup without a separate prompt from the user.

opentrain_get_job_setup is read-only. It returns canonical evidence, ordered questions, proposed defaults, exact write previews, approval requirements, and the bounded setup.* coordination view. The MCP initialize instructions tell the agent to:

  1. read the packet and inspect existing setup work;
  2. declare a setup.* intent before prompting;
  3. stand down when DUPLICATE identifies another winner;
  4. prove the winning intent’s non-null sessionId equals the current result’s non-null sync.session.sessionId, with the same principal;
  5. present a zero-write plan for human approval;
  6. re-read setup and prove ownership again immediately before approved writes; and
  7. verify, resolve the intent, and record a handoff.

A visible winner ID never transfers ownership. Null or mismatched sessions stand down and establish a durable per-agent session or coordinate with the owner. Once the packet reports COMPLETE or DEFERRED, agents stop prompting the employer team.

See Set Up Shared Job Operations for the complete flow.

MCP initialize guidance and every covered synchronized result teach the agent that atomic work is per-job data, never a platform enum. The result’s sync.workCatalog, sync.recommendations, and sync.nextOperations identify an unconfigured catalog, recurring provisional work, a pending human approval, or work another session already owns. The user does not have to know that a catalog exists or ask the agent to set it up.

ToolPurpose
opentrain_list_job_context_work_definitionsList this job’s draft, active, or archived definitions and current immutable bindings.
opentrain_get_job_context_work_definitionRead one definition’s current/latest version, exact grammar, digests, and bounded history.
opentrain_list_job_context_work_executionsList open or terminal defined/provisional executions and their one coordinating action/claim state.
opentrain_begin_provisional_job_context_work_executionCoordinate real ad hoc work before the job has an approved reusable definition.
opentrain_propose_job_context_work_definitionPropose an inactive inferred definition from one provisional execution.
opentrain_create_job_context_work_definitionCreate an attributed draft definition when its semantics are already decided.
opentrain_append_job_context_work_definition_versionAppend an immutable successor against the exact latest binding.
opentrain_activate_job_context_work_definitionActivate an approved version against exact revision and binding preconditions.
opentrain_archive_job_context_work_definitionArchive a definition only after its open-work and migration blockers are resolved.
opentrain_begin_job_context_work_executionBegin defined work against the exact current binding and mint its coordinating action.
opentrain_promote_job_context_work_executionPromote an exact provisional execution to an approved definition without inferring targets from text.
opentrain_start_job_context_work_migrationStart a separately approved, frozen migration between exact definition versions.
opentrain_run_job_context_work_migration_batchContinue the bounded crash-safe migration until its durable result is complete.

One durable session wins the ops:work-catalog-setup intent. Other sessions stand down. An inferred definition cannot activate itself: the responsible non-agent manager reviews its complete semantics and possible-duplicate packet, records the required typed approval, and only then may the winning agent append and activate the decided successor.

Every work execution mints exactly one coordinating Job Operations action. Its claim is the ownership authority. Long-running work uses opentrain_renew_job_context_action; responsibility changes use opentrain_handoff_job_context_action, after which the named recipient claims normally. No receipt transfers between agents.

The human-only WORK_COORDINATION_MODE policy selects OPEN, COORDINATED, or MANAGED. A null projection is unreadable and fail-closed, not an implicit OPEN. When a guarded mutation is refused, inspect its typed recovery details, begin the permitted defined or provisional execution, claim its action, and then retry against fresh canonical state.

External state remains unknown unless a current attestation covers it. opentrain_record_job_context_observation accepts a strict top-level externalAttestation for OBSERVED evidence and a top-level actorAgentLabel. Read the Agent Guide’s externalCoverage projection; expired, invalidated, superseded, branched, or unreadable evidence is not current.

See Dynamic Work Catalog for the complete lifecycle and agent protocol.

ToolPurpose
opentrain_list_job_context_signalsPage through deterministic signals in priority order. Shadow rules are excluded unless an authorized audit read explicitly includes them.
opentrain_get_job_context_signalRead one privacy-safe signal, evidence references, revisions, and latest linked-action state.
opentrain_acknowledge_job_context_signalAcknowledge one occurrence without claiming or clearing it.
opentrain_snooze_job_context_signalSnooze one occurrence until a bounded future time without claiming or clearing it.
opentrain_dismiss_job_context_signalDismiss one occurrence with an audited reason. Recurrence or materially changed evidence can reopen work.
opentrain_claim_job_context_signalAtomically create or reuse the linked action and acquire its authenticated lease. This is the only signal-to-owned-work path; it requires an active, fresh signal whose effective triage is open or acknowledged.

Treat signal priority as an investigation aid, not a proven root cause or permission to mutate canonical state. Stale and incomplete evaluator runs stay visible in context health, but are not presented as current actionable priorities. Only an evaluator clears the underlying condition; triage does not.

ToolPurpose
opentrain_list_job_context_actionsList actions and their status, owner, dependencies, due date, lease, and revision.
opentrain_create_job_context_actionCreate one coordinated action with evidence and optional dependencies.
opentrain_claim_job_context_actionClaim an eligible action with an authenticated, expiring lease.
opentrain_release_job_context_actionRelease the caller’s unexpired claim.
opentrain_complete_job_context_actionComplete the caller’s unexpired claim with a verified outcome receipt.
opentrain_cancel_job_context_actionCancel nonterminal work with an audited reason.

Dependencies must be complete before claim. A different agent cannot take an unexpired claim, and an expired claimant cannot release or complete it. Every transition carries expectedActionRevision and an idempotency key.

Signal claims also fail closed for stale, incomplete, live-snoozed, dismissed, or shadow-rule signals. Refresh context and wait for a complete fresh evaluator result instead of turning health metadata into owned work.

ToolPurpose
opentrain_declare_job_context_intentDeclare spontaneous work before it begins. An overlapping active intent returns the current winner instead of creating a race.
opentrain_list_job_context_intentsPage through active or resolved intents.
opentrain_resolve_job_context_intentComplete, abandon, reject, or promote the caller’s exact intent revision.
opentrain_submit_job_context_proposalRecord a non-enforced policy, workflow, priority, goal, exception, or capability alternative for review.
opentrain_list_job_context_proposalsPage through proposals and their review state.
opentrain_review_job_context_proposalAccept or decline an exact proposal revision. Acceptance links separately authorized canonical work and executes nothing.
opentrain_withdraw_job_context_proposalWithdraw the caller’s open proposal.
opentrain_get_job_context_overlaysRead TEAM, PERSONAL, and SESSION guidance with attribution and typed-reference lint results.
opentrain_set_job_context_overlayReplace one exact overlay revision. An empty entry list clears that layer.

Use an intent when the work has no shared action yet. Use a proposal when a project manager wants a different workflow or policy. Use overlays for flexible guidance at the correct scope. TEAM guidance is owner-controlled, PERSONAL guidance belongs to one manager, and SESSION guidance is scratch context for one agent connection. Overlay text is untrusted and cannot change canonical gates, readiness, or effective policies.

When a recommendation suggests another OpenTrain feature, treat it as product discovery rather than write authority. For example, inspect the evidence and show a no-write LMS retraining outline before asking the employer to approve course creation or assignment.

ToolPurpose
opentrain_publish_job_context_briefPublish the objective and versioned typed readiness workflow.
opentrain_list_job_context_decisionsPage through durable policies, judgments, holds, and exceptions with current, superseded, scheduled, or expired status and explicit visibility.
opentrain_record_job_context_decisionRecord or supersede a policy, judgment, hold, or approved exception.
opentrain_list_job_context_observationsPage through typed evidence, inferences, and recommendations with explicit visibility, optionally scoped to one person.
opentrain_record_job_context_observationRecord typed external evidence, inference, or recommendation.
opentrain_acknowledge_job_contextCheckpoint the last fully consumed context revision.
opentrain_record_job_context_handoffLeave a structured summary and open items for the next manager or agent.
ToolPurpose
opentrain_get_job_context_effective_policiesRead the current typed-policy head per key and enforcement state.
opentrain_list_job_context_policy_historyPage through append-only attributed policy revisions, including superseded and expired history.
opentrain_record_job_context_policyRecord the first typed policy revision or supersede the exact active decision head.
opentrain_verify_job_context_policy_enforcementAttach verified evidence to an externally enforced policy that is still pending.
opentrain_get_job_context_agent_guideRead the composite Agent Guide: the typed projection plus the published Playbook and open-proposal count, as JSON and Markdown.
opentrain_get_job_context_playbookRead the published Playbook head.
opentrain_list_job_context_playbook_versionsPage the newest-first Playbook version history.
opentrain_get_job_context_playbook_versionRead one exact published version.
opentrain_get_job_context_playbook_deltaRead the exact section delta between two versions, including removedSectionIds tombstones.
opentrain_submit_job_context_playbook_proposalSubmit a SECTION_UPSERT, SECTION_REMOVE, or NOTE proposal (recommended, never enforced).
opentrain_list_job_context_playbook_proposalsList proposals oldest first with effective expiry and staleness against the head.
opentrain_resolve_job_context_playbook_proposalAccept, decline, or withdraw an exact proposal revision.
opentrain_publish_job_context_playbookPublish a Playbook version from the closed editor-subset document. Human job-manager court only.
opentrain_get_job_context_operating_guideRead the canonical typed projection alone (the Agent Guide without the Playbook). Kept for existing clients.

The Agent Guide is also exposed as the read-only MCP resource template opentrain://jobs/{jobId}/operations/agent-guide with MIME type text/markdown; opentrain://jobs/{jobId}/operations/guide carries the canonical projection only. Use the tool when you need structured JSON and exact revision/checksum fields; use the resource when an MCP host wants the guide as a durable instruction document. Resource discovery is optional—the initial context call already carries the guide digest and remains the required bootstrap, and the initialize protocol directs the one Agent Guide read and the exact delta follow-up automatically. See Follow and Improve the Agent Guide.

Use a typed policy—not chat history, an observation, or a local prompt—when a change governs the job-wide workflow or agent behavior. Policy records preserve the approving user, recording user, recording agent, effective time, supersession, and enforcement target. Fetch context and the guide again after a change and verify their revisions and checksum.

GUIDE with status APPLIED means OpenTrain published the rule in the shared guide. It does not assert runtime enforcement elsewhere. The TRAINING_PRODUCTION_GATE v1 payload accepts only schemaVersion and basis; record a one-production-task stop instruction separately as OPERATING_RULE.first-production-task-limit with the GUIDE target.

The Agent Guide is the shared AGENTS.md-equivalent for the job. Its typed projection is read-only; canonical records and effective typed policies remain authoritative, and the published Playbook is guidance beneath them.

Context-changing mutations carry expectedContextRevision and an idempotency key. A 409-equivalent tool error means refresh and deliberately re-evaluate; never blind-retry a stale management decision.

Shared context intentionally excludes message bodies, assessment answers, identity documents, detailed location/fraud signals, provider secrets, and other sensitive payloads. Immediately before an outbound message or consequential write, use the canonical OpenTrain tool for the affected record and conversation. If another employer teammate already responded or the worker already completed the requested gate, discard the stale action.

For claimed context work, call opentrain_send_managed_job_message. Include a complete jobOperationsGuard with the exact jobId, context revision, action ID, action revision, signed claim receipt, and expectedLatestMessageId. The latest message field is null only when the authorized conversation was observed empty. The idempotency key must be 8–128 characters using letters, numbers, ., _, :, or -.

This tool requires both messages:write and messages:manage. OpenTrain resolves the authorized Job Message or Proposal Message to its canonical job, then commits the message and context advance atomically. Any stale state fails before message or notification creation. The generic opentrain_send_message tool deliberately accepts no guard and does not advance shared context.

Tools return machine-readable structuredContent, including the resource IDs, context/action revisions, completeness, and replay state returned by the API. Agents should reason from those fields instead of parsing display prose.

See the Shared Job Context concept, live-job guide, and HTTP reference.