tool_config
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentJobsToolsConfig codexed.models.tool_config Configuration for CSV-backed agent job tools. |
||
| ApplyPatchToolConfig codexed.models.tool_config Configuration for the apply_patch tool. |
||
| ArtifactsToolConfig codexed.models.tool_config Configuration for the artifacts tool. |
||
| BuiltinToolsConfig codexed.models.tool_config Combined configuration for all Codex builtin tools. |
||
| CollabToolsConfig codexed.models.tool_config Configuration for multi-agent collaboration tools. |
||
| GrepFilesToolConfig codexed.models.tool_config Configuration for the grep_files tool (experimental). |
||
| ImageGenerationToolConfig codexed.models.tool_config Configuration for the image_generation tool. |
||
| JsReplToolConfig codexed.models.tool_config Configuration for the js_repl / js_repl_reset tools. |
||
| ListDirToolConfig codexed.models.tool_config Configuration for the list_dir tool (experimental). |
||
| McpResourceToolsConfig codexed.models.tool_config Configuration for MCP resource browsing tools. |
||
| PlanToolConfig codexed.models.tool_config Configuration for the update_plan tool. |
||
| ReadFileToolConfig codexed.models.tool_config Configuration for the read_file tool (experimental). |
||
| RequestPermissionsToolConfig codexed.models.tool_config Configuration for the request_permissions tool. |
||
| RequestUserInputToolConfig codexed.models.tool_config Configuration for the request_user_input tool. |
||
| ShellToolConfig codexed.models.tool_config Configuration for the shell / exec tool. |
||
| ToolSearchToolConfig codexed.models.tool_config Configuration for the tool_search tool (requires apps). |
||
| ToolSuggestToolConfig codexed.models.tool_config Configuration for the tool_suggest tool (requires discoverable tools). |
||
| ViewImageToolConfig codexed.models.tool_config Configuration for the view_image tool. |
||
| WebSearchToolConfig codexed.models.tool_config Configuration for the web_search tool. |
🛈 DocStrings¶
Builtin tool configuration models for Codex app-server.
Each builtin tool has a dedicated Pydantic model with a type discriminator
field. All tool configs are collected in the ToolConfig discriminated union
so that list[ToolConfig] can be used as a typed parameter.
A BuiltinToolsConfig convenience model groups all tools with named fields,
while :func:tools_to_config_dict converts an arbitrary list[ToolConfig]
into the config dict accepted by ThreadStartParams.
ToolConfig
module-attribute
¶
ToolConfig = Annotated[
ShellToolConfig
| ApplyPatchToolConfig
| WebSearchToolConfig
| ImageGenerationToolConfig
| ViewImageToolConfig
| PlanToolConfig
| JsReplToolConfig
| CollabToolsConfig
| AgentJobsToolsConfig
| RequestUserInputToolConfig
| RequestPermissionsToolConfig
| ArtifactsToolConfig
| GrepFilesToolConfig
| ReadFileToolConfig
| ListDirToolConfig
| ToolSearchToolConfig
| ToolSuggestToolConfig
| McpResourceToolsConfig,
Discriminator("type"),
]
Discriminated union of all builtin tool configurations.
AgentJobsToolsConfig
¶
Bases: _ToolConfigBase
Configuration for CSV-backed agent job tools.
Controls spawn_agents_on_csv and report_agent_job_result.
Source code in src/codexed/models/tool_config.py
ApplyPatchToolConfig
¶
Bases: _ToolConfigBase
Configuration for the apply_patch tool.
Source code in src/codexed/models/tool_config.py
variant
class-attribute
instance-attribute
¶
Patch format variant.
ArtifactsToolConfig
¶
BuiltinToolsConfig
¶
Bases: BaseModel
Combined configuration for all Codex builtin tools.
Provides named fields as a convenience over list[ToolConfig].
Call :meth:to_config_dict to obtain the config dict for
ThreadStartParams, or :meth:to_tool_list to get a
list[ToolConfig].
Example::
tools = BuiltinToolsConfig(
web_search=WebSearchToolConfig(mode="live", context_size="high"),
js_repl=JsReplToolConfig(),
)
params = ThreadStartParams(config=tools.to_config_dict())
Source code in src/codexed/models/tool_config.py
to_config_dict
¶
Serialize into a flat config dict for ThreadStartParams.config.
Only explicitly set tools are included. An empty BuiltinToolsConfig
produces an empty dict (server defaults preserved).
Source code in src/codexed/models/tool_config.py
to_tool_list
¶
to_tool_list() -> list[ToolConfig]
Return only explicitly set tool configs as a list.
Source code in src/codexed/models/tool_config.py
CollabToolsConfig
¶
Bases: _ToolConfigBase
Configuration for multi-agent collaboration tools.
Controls spawn_agent, send_input, resume_agent,
wait_agent, and close_agent.
Source code in src/codexed/models/tool_config.py
GrepFilesToolConfig
¶
ImageGenerationToolConfig
¶
JsReplToolConfig
¶
ListDirToolConfig
¶
McpResourceToolsConfig
¶
Bases: _ToolConfigBase
Configuration for MCP resource browsing tools.
Controls list_mcp_resources, list_mcp_resource_templates,
and read_mcp_resource.
Source code in src/codexed/models/tool_config.py
PlanToolConfig
¶
ReadFileToolConfig
¶
RequestPermissionsToolConfig
¶
Bases: _ToolConfigBase
Configuration for the request_permissions tool.
Source code in src/codexed/models/tool_config.py
RequestUserInputToolConfig
¶
ShellToolConfig
¶
Bases: _ToolConfigBase
Configuration for the shell / exec tool.
Source code in src/codexed/models/tool_config.py
allow_login_shell
class-attribute
instance-attribute
¶
Whether the model may request a login shell.
ToolSearchToolConfig
¶
ToolSuggestToolConfig
¶
Bases: _ToolConfigBase
Configuration for the tool_suggest tool (requires discoverable tools).
Source code in src/codexed/models/tool_config.py
ViewImageToolConfig
¶
WebSearchToolConfig
¶
Bases: _ToolConfigBase
Configuration for the web_search tool.
Source code in src/codexed/models/tool_config.py
tools_to_config_dict
¶
tools_to_config_dict(tools: list[ToolConfig]) -> dict[str, Any]
Convert a list of tool configs into the config dict for ThreadStartParams.
Each tool config contributes its settings to the appropriate config keys. An empty list explicitly disables all builtin tools.
Example::
config = tools_to_config_dict([]) # disable all tools
config = tools_to_config_dict([ # enable only these
WebSearchToolConfig(mode="live", context_size="high"),
JsReplToolConfig(),
])
Source code in src/codexed/models/tool_config.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |