Skip to content
Reference

m3.matrix ​

Signatures use ... for factory-backed or opaque defaults. Model field tables show required status, defaults, constraints, and descriptions.

ToolCase ​

python
m3.matrix.ToolCase(
    *,
    name: str,
    id: str | None = None,
    arguments: collections.abc.Mapping[str, Any] = ...,
    prompt: str | m3.types.UserMessage | None = None,
) -> None

One deterministic call definition owned by a server case.

Model fields:

FieldTypeRequiredDefaultConstraintsDescription
namestrYes—min_length=1, max_length=256—
idstr | NoneNoNonemin_length=1, max_length=256—
argumentscollections.abc.Mapping[str, Any]Nofactory builtins.dict()——
promptstr | m3.types.UserMessage | NoneNoNone——

ServerCase ​

python
m3.matrix.ServerCase(
    *,
    name: str,
    server: m3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServer,
    tools: tuple[m3.matrix.ToolCase, ...],
) -> None

A serializable MCP server and its owned logical tool cases.

Model fields:

FieldTypeRequiredDefaultConstraintsDescription
namestrYes—min_length=1, max_length=256—
serverm3.types.StdioServer | m3.types.HTTPServer | m3.types.InProcessServerYes—discriminator='kind'—
toolstuple[m3.matrix.ToolCase, ...]Yes———
python
tool(
    self,
    logical_id: str,
) -> ToolCase

Return the tool with logical_id or raise a clear lookup error.

ToolMatrix ​

python
m3.matrix.ToolMatrix(
    *,
    servers: tuple[m3.matrix.ServerCase, ...],
    id: str | None = None,
    matrix_id: str | None = None,
    trials: int = 1,
) -> None

Expand server-owned deterministic tool cases in declared order.

Model fields:

FieldTypeRequiredDefaultConstraintsDescription
serverstuple[m3.matrix.ServerCase, ...]Yes———
idstr | NoneNoNonemin_length=1, max_length=256—
matrix_idstr | NoneNoNonemin_length=1, max_length=256—
trialsintNo1strict=True, ge=1—
python
cases(
    self,
) -> tuple[ToolMatrixCase, ...]
python
parametrize(
    self,
    argname: str = 'case',
) -> _pytest.MarkDecorator

Return pytest's ordinary parametrization decorator for this matrix.

ToolMatrixCase ​

python
m3.matrix.ToolMatrixCase(
    *,
    id: str,
    server: m3.matrix.ServerCase,
    tool: m3.matrix.ToolCase,
    matrix_id: str | None = None,
    cell_id: str | None = None,
    trial: int = 1,
    trial_count: int = 1,
) -> None

One server-owned deterministic tool cell.

Model fields:

FieldTypeRequiredDefaultConstraintsDescription
idstrYes—min_length=1, max_length=1024—
serverm3.matrix.ServerCaseYes———
toolm3.matrix.ToolCaseYes———
matrix_idstr | NoneNoNone——
cell_idstr | NoneNoNone——
trialintNo1strict=True, ge=1—
trial_countintNo1strict=True, ge=1—
python
run(
    self,
    *,
    kit: _MCPTestKit | None = None,
    timeout: float | None = None,
    validate_schemas: bool = False,
    metadata: _Mapping[str, _Scalar] | None = None,
) -> _ExecutionResult

Run this cell through the normal synchronous execution boundary.

python
run_async(
    self,
    *,
    kit: _AsyncMCPTestKit | None = None,
    timeout: float | None = None,
    validate_schemas: bool = False,
    metadata: _Mapping[str, _Scalar] | None = None,
) -> _ExecutionResult

Run this cell through the normal asynchronous execution boundary.