What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
First identify which layer failed: a function call in generated application code, or a tool call the agent asked its host application to run. They can look alike in a transcript, but the fixes differ. For code, trace the symbol and its imports before adding a helper. For a runtime tool call, check that the tool was registered, dispatched, and answered in the current turn.
Identify what “function does not exist” means
Read the error and locate the call site. A compiler or runtime error tied to a line of source code usually points to an undefined name, a missing import, or a visibility problem. A structured tool-call event instead means the model asked its surrounding application to run a named function. That request is not itself execution: the application or harness must provide and run the handler.
- Generated source-code call: inspect the project’s code, symbol definitions, module boundaries, and build or runtime error.
- Agent tool call: inspect the tool definitions sent to the model, the current action or event, and the application’s dispatch and result handling.
Do not edit application code to solve a tool-registration failure, or change tool configuration to solve a missing source-code import.
Fix a missing function in generated code
Start at the failing call and search the repository for the symbol and for code that already performs the same job. An agent may have guessed a name, overlooked an existing helper, or used a symbol that is not visible from the current module. VS Code’s guidance recommends treating an agent’s explanation as a starting point to verify against the codebase, not as proof of what the code does (codebase exploration guidance).
#1 Best Overall
Check the existing implementation before creating one
- The helper exists and is exported: import it from the correct module and follow the project’s naming conventions.
- It exists but is private or out of scope: use the project’s established module boundary to expose it, or place the call where the owning module can perform the work.
- A similar helper exists under another name: verify that its behavior matches, then correct the identifier or import rather than duplicating it.
- No suitable implementation exists: add the function where the project expects shared behavior to live, and write or update a focused test.
A community report describes the practical risk of adding a duplicate utility when an equivalent already exists; it is an anecdote, not evidence about how often agents make this mistake (community report). Search first, then review any new helper against existing call sites and tests.
Fix an agent tool call that the host does not handle
In a tool-using system, the model requests a function and the application executes it. OpenAI’s function-calling guide describes this application-mediated cycle: provide available tools, receive a call, execute it, return the result, and continue the interaction (OpenAI function-calling guide). Anthropic describes a comparable client-tool flow using a tool_use block followed by application execution and a tool_result (Anthropic tool-use documentation). The request and response formats differ by provider.
Verify registration, dispatch, and the returned result
- Inspect the definitions actually sent to the model. Confirm that the requested function name is present, spelled exactly as expected, and has a schema that matches the handler’s arguments.
- Check whether the current turn has an action to run. In OpenAI Agents API sessions, use
required_actionsto identify calls awaiting results. Afunction_callitem in session history alone does not mean a result is still pending (OpenAI Agents API sessions documentation). - Confirm the application dispatches the action. If the tool is defined but never reaches its handler, repair the dispatch path or its error handling.
- Return the outcome for that call. Send a success result when execution succeeds; on failure, return a clear, actionable error associated with the relevant call identifier. Do not report success if the handler did not complete.
If the tool was never registered, add or correct both its definition and executable handler, then verify the definition appears in the request or session. For broader API failures, OpenAI’s Agents API guidance recommends checking the error at the request, turn, session, or environment layer before retrying (OpenAI Agents API troubleshooting).
Prevent repeat failures with project-specific instructions and checks
Tell the agent facts it cannot reliably infer: where shared helpers belong, which module owns a behavior, import and naming conventions, and the repository’s actual build, test, and lint commands. VS Code recommends project-specific instructions that describe architecture, commands, conventions, and a definition of done, while advising users to review generated instructions rather than accept them blindly (VS Code custom instructions).
Check that the harness discovers the instruction file and that its scope includes the files being edited. VS Code cautions that “Instructions guide the model, but don’t guarantee that it follows every rule.” Its documentation recommends checking references or debug logs when instructions do not appear to apply (VS Code custom instructions).
A useful repository rule is: “Before adding a function, search for an existing implementation with the same behavior. Check its call sites, exports, and tests. Reuse it or explain why it does not fit. Before finishing, report the validation commands you ran and their results.” Tailor it to the project’s real structure and commands. Then review the diff and run the relevant existing checks; an instruction or agent summary is not a substitute for verification.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools

