Script Tools#
Script tools are explicit ScriptToolConfig entries passed to Toolbox or loaded
from script_tools runtime config. Each tool points to a local .py or .sh
script and uses a JSON stdin/stdout envelope contract.
Execution contract#
Runtime sends JSON input over
stdin.Script prints exactly one JSON object on
stdout.Runtime validates output into canonical
ToolResult.
Envelope shape#
Scripts must print one JSON object with keys:
okresultartifactswarningserror(optional)
Programmatic helpers#
from design_research_agents import ScriptToolConfig, Toolbox
runtime = Toolbox(
script_tools=(
ScriptToolConfig(
name="rubric_score",
path="examples/tools/script_tools/rubric_score.py",
description="Score text with a simple rubric.",
),
)
)
names = [spec.name for spec in runtime.list_tools() if spec.metadata.source == "script"]
result = runtime.invoke(
"script::rubric_score",
{"text": "hello"},
request_id="docs-script",
dependencies={},
)
runtime.close()
Troubleshooting#
Script tool missing from
Toolbox.list_tools(): verifyscript_toolsconfig and script path.Unknown script tool: verifyscript::prefix and canonical tool name.stdout must be JSON: log to stderr, emit one JSON object on stdout.
Examples#
examples/tools/script_tools/README.mdexamples/tools/script_tools/rubric_score.pyexamples/tools/script_tools/repo_quickscan.sh