Tool publication and readiness
Publish tool schemas, find acknowledged versions and check policy readiness.
On this page
Publish tools with a managed AgentCheck policy readiness for a write toolRegister tools with a direct Python clientReconcile missing or changed toolsPublish tools with a managed Agent
Call publish() or apublish() to send tool names, descriptions and input schemas before the first model call. If you invoke or batch the Agent first, the SDK starts publication automatically.
When snapshot.publication_complete is true, the catalog has been acknowledged. If it is false, inspect the retained agent.catalog_snapshot() and agent.catalog_status() before using the version IDs. Use the published tool version in Agent onboarding to review its classification and configure policies for writes.
Check policy readiness for a write tool
This example checks issue_refund in one managed session. Use the published name of your write tool. Its registration supplies the capability and acknowledged version ID. The live readiness report supplies the policy status for that version.
For a governed write, check for the Write classification, active governance and the readiness reason ready. Read-only and observe-only tools can also be eligible and policy-ready. Once the write is ready, the policy evaluates each call’s arguments and can allow it, require approval or deny it.
tool_name = "issue_refund"
with agent:
agent.publish()
agent.flush()
snapshot = agent.catalog_snapshot()
registration = next(
(r for r in snapshot.results if r.tool and r.tool.name == tool_name),
None,
)
if registration is None or registration.tool_version is None:
raise RuntimeError(f"No acknowledged version for {tool_name}")
version_id = registration.tool_version.id
report = agent.readiness()
tool = next(
(item for item in report.readiness.tools if item.tool_version_id == version_id),
None,
)
if tool_name in report.unpublished or tool is None:
print("Publication or readiness unconfirmed for this version")
elif (
registration.tool.capability == "write"
and tool.governed
and tool.eligible
and tool.policy_ready
and tool.reason == "ready"
):
print("Ready for policy evaluation")
else:
print("Check classification and policy binding:", tool.reason)Expected result · Review the tool’s classification and policy binding in Agent onboarding if it is still unready.
Register tools with a direct Python client
Call client.register_tools(registrations) and match each result to its input by request_index. For each tool, require a status of registered or replayed and both result.tool and result.tool_version. Save their IDs for readiness checks and schema updates.
To check readiness, call client.get_tool_readiness(tool_version_ids=[version_id]) and match the returned entry to the acknowledged version. Use the registration’s tool capability and the readiness fields shown above.
For invalid, check the registration inputs. For conflict, reconcile the current version before retrying.
Reconcile missing or changed tools
If a tool is missing, inspect catalog_status() for publication errors and catalog_snapshot().results for registration results. Entering a managed session starts publication and acknowledgment can arrive later.
When updating a schema through direct registration, set expected_tool_id and expected_current_version_id from the last acknowledged registration. Reuse those IDs for an identical transport retry. After a conflict, compare the current schema before submitting a revised registration. Check the policy binding for the newly published version.
Advanced · diagnose publication acknowledgment
Diagnostic integration snippet · supply your model, tools and openeight_config. Use only when investigating publication acknowledgment.
import time
from openeight.langchain import create_agent
with create_agent(
model=model, tools=tools, openeight=openeight_config,
) as agent:
agent.flush()
deadline = time.monotonic() + 10.0
while not agent.catalog_snapshot().publication_complete:
publication = agent.catalog_status().publication
state = publication["catalog_delivery_state"]
if state in {"failed", "partial", "dropped"} or time.monotonic() >= deadline:
raise RuntimeError(
f"Publication {state}: {publication['catalog_failed_tools']} failed, "
f"{publication['catalog_dropped_tools']} dropped, "
f"{publication['catalog_pending_tools']} pending"
)
time.sleep(0.05)
print(agent.catalog_snapshot())
print(agent.catalog_status())
Expected result · publication_complete confirms catalog publication, not policy activation. Normal invocation needs no publication loop.