Howto codex

Static reading edition · s05-05

Distinguish finding a tool from searching content

MCP19 min estimatedApp / CLI / IDE

Discover the operation needed for a task and avoid applying API or Claude settings to Codex without evidence.

Understand the approach

Tool discovery asks which operation can answer a request. Content search uses a chosen operation to locate documents, tickets or records. Keeping these separate prevents a common confusion: discovering a documentation search tool does not mean you have searched the documentation yet. Reading a result is another step. A reliable trace can therefore contain discovery, search and read, with a distinct observation at each stage.

Some agent hosts expose deferred tool discovery so they do not present every tool schema at once. OpenAI's API Tool search guide documents API-specific setup, including deferred loading. That is not a Codex configuration recipe. The current local Codex guide provides /mcp for inspecting configured capabilities and tool allow/deny controls, but does not establish the source course's Claude search switches as Codex controls. Do not paste an API tools array or a Claude environment variable into config.toml and assume it enables the same mechanism.

Learn the distinction by working backward from a narrow question. To verify a setting, you need an operation that searches official documentation and another that reads the matching page. Ask Codex to identify the operations it actually has, rather than listing attractive tool names from memory. If your environment presents a complete catalogue instead of a search step, record that honestly. The goal is correct selection and retrieval; a visible discovery call is not mandatory in every client and is not a measure of answer quality.

Inspect server.cjs’s actual inputSchema: list_tasks accepts optional string query and searches titles; get_task requires an exact string id; read_task_snapshot takes no arguments. A no-such-title search yields isError:false and total:0. An unknown ID yields isError:true; the absent erase_all tool returns protocol error -32602. These are distinct observable contracts. The transcript contains tools/list followed by content calls, not proof of deferred model-side schema loading. If native Codex presents a full catalog instead, demonstrate correct selection, retrieval and reconciliation rather than inventing a discovery API or a token-saving figure.

Capability discovery and content retrieval are two searches

Finding which tool can search a source is capability discovery. Calling that tool with a query retrieves content. The retrieved page must still be read before a conclusion is supported.

Finding which tool can search a source is capability discovery. Calling that tool with a query retrieves content. The retrieved page must still be read before a conclusion is supported.

Open the full diagram

Practice and acceptance

Finding an operation, invoking it and interpreting source content are separate observable steps.

About your environment

Checked 21 October 2026. This lesson describes observable host behavior, not a universal tool-discovery flag.

Try it step by step

  1. Read the linked lab guide, inputs and expected outputs before running the exercise.
  2. Write a specific lookup goal and the operation characteristics required, such as read-only documentation search with page retrieval.
  3. Inspect the current client or ask Codex to identify matching available capabilities. In an interactive CLI, /mcp can help inspect connected tools.
  4. If the host exposes deferred discovery, use it to locate the operation. Otherwise select from the available catalogue and note that no separate search was needed.
  5. Run the content query, read the supporting result and return an answer with a source URL. Keep discovery activity separate from evidence retrieval.
  6. Review the trace for unnecessary catalogue expansion or repeated searches. Compare useful results and observed effort without inventing token savings.

A useful starting example

Illustration · adapt before use.

Complete MCP requests after initialization: discover, then look up jsonl
{"jsonrpc":"2.0","id":10,"method":"tools/list","params":{}}
{"jsonrpc":"2.0","id":11,"method":"tools/call","params":{"name":"list_tasks","arguments":{"query":"README"}}}
{"jsonrpc":"2.0","id":12,"method":"tools/call","params":{"name":"get_task","arguments":{"id":"T-102"}}}
From input to result

Choose by operation contract

A title query and exact record lookup require different arguments.

Worked input text
list_tasks arguments: {"query":" README "}
get_task arguments: {"id":"T-102"}
Expected result · compare with your run
Title query: T-101, total=1
Exact ID: T-102, status=done
Unknown title: successful total=0
Unknown ID: isError=true

A zero-result search is valid data; an unknown identifier error should not be silently flattened into the same result.

Hands-on exercise

Your turn

Annotate the transcript with three labels: operation discovery, content lookup and evidence interpretation. Choose get_task for an exact ID and list_tasks for a title search using their actual schemas. Explain why adding a larger catalogue would not by itself prove deferred tool search or token savings in Codex.

Try the exercise before opening its reference answer. Use a disposable practice folder.

Run the practice

Separate tool discovery from data search

Extract into a new practice folder and keep the included labs folder. Run these commands from that extraction root, or from the course folder, using an existing Node.js installation.

  1. Command 1 text
    node labs/mcp-workbench/demo.cjs --transcript

    Check: tools/list returns three schemas before tools/call searches task titles.

Finding an operation, invoking it and interpreting source content are separate observable steps.

Check your result

  • The report distinguishes discovering an operation from searching service content.
  • Only actual available capabilities are named as used.
  • API-specific tool_search setup and Claude-specific switches are not presented as verified Codex settings.
  • Local harness behavior and isolated native server discovery are distinguished from unrun app UI setup or model-selected tool calls.
Reference answer & rubric Try the exercise before opening

tools/list describes available operations; list_tasks performs a title query over the real local data. Neither is a universal host-side deferred-search feature.

  1. Inspect the distinct input schemas for list_tasks and get_task.
  2. Locate the tools/list response before selecting a capability.
  3. Use the existing calls/tests to compare a title query, an exact ID and an unknown tool name.
  4. Report the discovery method actually observed; leave host deferred-discovery behavior and savings unmeasured.
Think it through

Check your understanding

An API guide shows defer_loading and tool_search. What follows for Codex config.toml?

  1. Those API fields can be copied directly into any Codex configuration.
  2. Every connected MCP server must expose a tool literally named tool_search.
  3. Nothing automatically; verify the Codex host's documented controls separately.
Reveal the answer and explanation

Answer 3: Nothing automatically; verify the Codex host's documented controls separately.

API request schemas and end-user Codex configuration are different surfaces, even when they implement related ideas.

Take this quiz in the interactive lesson to save your answer in the browser.

When it does not work

A tools/list response is cited as the answer to a task query.

Likely cause: Capability descriptions were mistaken for source data.

What to try: Find the tools/call result and inspect the actual returned record.

A tool is guessed from its marketing name.

Likely cause: The real catalogue uses a different name or argument schema.

What to try: Read the returned schema and correct the call; preserve unknown-name errors as discovery feedback.

Common mistakes

  • Confusing /mcp server inspection with having searched a service's documents.
  • Claiming automatic performance improvements without observing the task, latency or usage in the relevant environment.
Source mapping & differences · different

The tool-discovery goal transfers, but Codex host behavior, OpenAI API tool_search configuration and Claude tool-search switches are separate interfaces.

Source topic: MCP tool search ↗

Go to the source

Official documentation, checked 21 October 2026. Product names, controls and availability may vary with your version, platform or account.

Continue in the interactive lesson →

Completion and quiz progress are saved
only in the interactive course.