ToolSpec#

Let a model keep its own tools and notes in a repository on disk. See the guide.

class zett_agent.jit_harness.host.ToolSpec(name, description, parameters, guidelines, snippet, execution_mode, return_schema=None, returns_description='')[source]#

Everything the agent needs to know about a repository tool before calling it.

It is the serializable half of an AgentTool: the schema and the prompt-facing text, without the handler that only lives where the code runs.

Parameters:
  • name (str)

  • description (str)

  • parameters (dict[str, JsonValue])

  • guidelines (tuple[str, ...])

  • snippet (str)

  • execution_mode (ToolExecutionMode)

  • return_schema (dict[str, JsonValue] | None)

  • returns_description (str)

classmethod of(tool)[source]#

Describe one imported tool.

Parameters:

tool (AgentTool)

Return type:

ToolSpec

to_json()[source]#

Render this spec as the JSON object the child sends.

Return type:

dict[str, JsonValue]

classmethod from_json(payload)[source]#

Read one spec from the child, rejecting anything that is not a tool description.

Parameters:

payload (Mapping[str, JsonValue])

Return type:

ToolSpec

build(invoke)[source]#

Rebuild the tool in the agent, with invoke as its handler.

Parameters:

invoke (Callable[[dict[str, JsonValue]], Awaitable[ToolResult]])

Return type:

AgentTool