OpenAI starter module
Tool calling
Lets models choose approved app actions while your server validates every input and result.
- Files
- 4
- Lines
- 364
- Languages
- TypeScript
Included files
This page lists paths and purposes, not source contents.
src/agentic/get-order-status-tool.ts
Defines the account-scoped order-status tool available to OpenAI responses.
TypeScript
43 lines
src/agentic/run-tool-loop.ts
Runs a capped OpenAI function-tool loop and records all step usage once.
TypeScript
176 lines
src/agentic/tool-registry.ts
Keeps the only tools OpenAI may request in one explicit application allowlist.
TypeScript
43 lines
src/agentic/tools-route.ts
Handles guarded tool-loop requests and maps allowlist failures to safe responses.
TypeScript
102 lines
Questions about tool calling
Does it include OpenAI tool calling and structured outputs?
Yes. It shows how to limit tools to approved actions, validate their inputs, and require model responses that match the shape your app expects.