MCP Schema Contract

August 2, 2026 ยท View on GitHub

Generated from crates/soma/domain/src/actions.rs and checked against the schema, README, skill docs, help text, and scope routing.

Run:

cargo xtask check-schema-docs --write
cargo xtask check-schema-docs --check

Tool

FieldValue
Tool namesoma
Schema resourcesoma://schema/mcp-tool
Dispatch parameteraction

Actions

ActionScopeCostDescription
greetsoma:readcheapReturn a greeting.
echosoma:readcheapEcho a message back unchanged.
statussoma:readcheapReturn server status and configuration info.
python_environment_statussoma:writecheapInspect immutable Python environment cache state without executing provider code.
python_environment_prune_plansoma:writemoderatePlan a bounded prune of stale non-ready Python environment cache entries.
python_environment_prunesoma:writewriteApply a bounded prune of stale non-ready Python environment cache entries.
python_environment_repairsoma:writewriteRepair the immutable environment for one managed Python provider.
python_environment_updatesoma:writewriteResolve, prepare, validate, and atomically activate an immutable update for one managed Python provider.
python_worker_statussoma:writecheapInspect persistent Python worker health, quarantine, restart counts, and bounded redacted logs.
python_worker_cancelsoma:writewriteCancel one active persistent Python invocation by terminating its process tree.
python_worker_resetsoma:writewriteClear one persistent Python worker crash-loop quarantine.
python_generation_statussoma:readcheapInspect the active Python provider generation and bounded rollback history.
python_generation_rollbacksoma:writewriteAtomically reactivate a retained Python provider generation.
python_graduation_statussoma:readcheapInspect digest-bound Python graduation, conformance, activation, and rollback state.
python_graduation_applysoma:writewriteScaffold, componentize, build, verify, compare, activate, or roll back a Python graduation workspace.
elicit_namesoma:readcheapAsk the MCP client to collect a name, then return a personalised greeting.
scaffold_intentsoma:readmoderateCollect scaffold setup intent through MCP elicitation and return JSON for the scaffold-project skill.
helppubliccheapShow the action reference.

Drift Rules

  • ACTION_SPECS in crates/soma/domain/src/actions.rs is the canonical action and scope list.
  • Action cost is planner metadata. Use cheap for first-pass reads, moderate for bounded workflow setup, expensive for broad scans or long-running work, and write for mutating operations.
  • crates/soma/mcp/src/schemas.rs must derive its enum from ACTION_SPECS.
  • The MCP tool schema must reject unknown top-level parameters except reserved _response_* continuation fields, and encode action-specific requirements that fit the single-tool dispatch model.
  • help is intentionally public and must have no required scope.
  • crates/soma/mcp/src/tools.rs, README.md, and plugins/soma/skills/soma/SKILL.md must mention every action.
  • crates/soma/mcp/src/rmcp_server.rs owns stable resources and must keep soma://schema/mcp-tool wired to tool_definitions().
  • crates/soma/mcp/src/prompts.rs owns stable prompts and must keep quick_start covered by prompt tests.

Resources

URISourceContract
soma://schema/mcp-toolcrates/soma/mcp/src/rmcp_server.rsReturns tool_definitions() as application/json.

Prompts

PromptSourceContract
quick_startcrates/soma/mcp/src/prompts.rsGuides a client to call status and greet.

Input Validation

  • action is always required.
  • echo conditionally requires non-empty message.
  • greet accepts optional name and defaults to World.
  • elicit_name and scaffold_intent collect their extra fields through MCP elicitation, not direct tool-call arguments.
  • Unknown top-level parameters are rejected by the schema except reserved MCP adapter continuation fields.

Reserved Adapter Parameters

Oversized MCP responses are returned as kind=mcp_response_page envelopes. Continuation calls reuse the same tool and original arguments, plus these reserved fields:

ParameterTypePurpose
_response_cursorstringCursor for cached serialized response data. Required with _response_offset.
_response_offsetintegerByte offset into the cached serialized response.
_response_page_bytesintegerPage size in bytes, from 1 to 16000.

The adapter strips these fields before dispatching to the service layer.