Agent tools¶
Local checks and compact result views used by the MCP server. These functions are also importable without the mcp extra. See the agent guide for the tool workflow.
Schema and capabilities¶
get_schema
¶
get_schema(definition: str | None = None) -> SchemaInfo
Return the local, read-only photonhub.schema/1 schema document.
capabilities
¶
capabilities() -> Capabilities
Return local, read-only photonhub.capabilities/1 solver facts.
Validation and planning¶
validate_spec
¶
validate_spec(
spec: str | Path | dict | Simulation,
device: str = "cpu",
engine: bool = True,
) -> ValidationReport
Return local, read-only photonhub.validation/1 checks for a spec.
estimate
¶
estimate(
spec: str | Path | dict | Simulation,
cpu_mcells_per_s_low: float = 20.0,
cpu_mcells_per_s_high: float = 300.0,
device: str = "cpu",
) -> LocalEstimate
Return local, read-only photonhub.estimate/1 planning bounds.
Result inspection¶
result_summary
¶
result_summary(
data_or_dir: RunResult | str | Path,
data_checks: bool = True,
) -> ResultSummary
Return local, read-only photonhub.result_summary/1 findings and provenance.
convergence_report
¶
convergence_report(
data_or_dir: RunResult | str | Path,
) -> ConvergenceSummary
Return local, read-only photonhub.convergence_report/1 evidence.
Output models¶
SchemaInfo
pydantic-model
¶
Bases: StrictModel
Local, read-only schema output for photonhub.schema/1.
Config:
extra:forbidpopulate_by_name:True
Fields:
-
contract(str) -
schema_version(str) -
schema_major(int) -
schema_sha256(str) -
definitions(list[str]) -
definition(str | None) -
schema_(dict[str, Any])
model_config
class-attribute
instance-attribute
¶
Capabilities
pydantic-model
¶
Bases: StrictModel
Local, read-only capability output for photonhub.capabilities/1.
Fields:
-
contract(str) -
sdk_version(str) -
schema_version(str) -
schema_major(int) -
solver(SolverInfo) -
devices(list[DeviceInfo]) -
cpu_only_features(list[CpuOnlyInfo]) -
pinned_features(list[str]) -
safety(SafetyInfo)
ValidationReport
pydantic-model
¶
Bases: StrictModel
Local validation output for photonhub.validation/1.
Fields:
-
contract(str) -
ok(bool) -
authoritative(bool) -
device(str) -
schema_version(str) -
input_sha256(str | None) -
input_sha256_basis(str | None) -
stages(dict[str, str]) -
issues(list[Issue]) -
counts(dict[str, int]) -
engine(EngineStatus)
LocalEstimate
pydantic-model
¶
Bases: StrictModel
Local, read-only planning output for photonhub.estimate/1.
Fields:
-
contract(str) -
cells_per_axis(tuple[int, int, int]) -
num_cells(int) -
num_steps(int) -
dt_s(float) -
cell_steps(int) -
tcell_steps(float) -
memory_bytes(int) -
output_bytes(int) -
cpu_seconds(SecondsRange) -
assumptions(EstimateAssumptions) -
notes(list[str])
ResultSummary
pydantic-model
¶
Bases: StrictModel
Local, read-only result output for photonhub.result_summary/1.
Fields:
-
contract(str) -
output_dir(str) -
input_sha256(str | None) -
input_sha256_source(str | None) -
geometry_status(str) -
manifest_version(str | None) -
schema_version(str | None) -
solver(dict[str, Any]) -
device(dict[str, Any]) -
run(dict[str, Any]) -
grid(dict[str, Any]) -
monitors(list[ResultMonitor]) -
issues(list[Issue]) -
counts(dict[str, int]) -
convergence(ConvergenceLocation)
ConvergenceSummary
pydantic-model
¶
Bases: StrictModel
Local, read-only output for photonhub.convergence_report/1.
Fields:
-
contract(str) -
found(bool) -
path(str | None) -
relation(str | None) -
format(str | None) -
converged(bool | None) -
metric_name(str | None) -
stop_reason(str | None) -
tol(float | None) -
patience(int | None) -
finest(float | None) -
drift_successive(float | None) -
drift_total(float | None) -
total_cost_usd(float | None) -
ladder(list[dict[str, Any]] | None) -
keys(list[str] | None) -
message(str | None)
Issue
pydantic-model
¶
Bases: StrictModel
A stable finding from a local, read-only tool.
Fields:
SolverInfo
pydantic-model
¶
Bases: StrictModel
Solver facts from local, read-only capability probes.
Fields:
-
found(bool) -
path(str | None) -
version(str | None) -
git_sha(str | None) -
gpu_available(bool | None) -
gpu_platform(str | None) -
openmp(bool | None) -
devices(list[Any] | None) -
features(list[str] | None) -
feature_drift(list[str] | None) -
error(str | None)
DeviceInfo
pydantic-model
¶
CpuOnlyInfo
pydantic-model
¶
SafetyInfo
pydantic-model
¶
Bases: StrictModel
Side effect flags for a local, read-only capability report.
Fields:
-
spends_money(bool) -
network(bool) -
cloud_submission(bool)
EngineStatus
pydantic-model
¶
SecondsRange
pydantic-model
¶
EstimateAssumptions
pydantic-model
¶
Bases: StrictModel
Throughput assumptions for a local, read-only estimate.
Fields:
-
cpu_mcells_per_s(list[float]) -
basis(str)