---
title: "How tool calls work"
kind: "explain"
audiences: ["strategist","rep"]
track: "agent-fundamentals"
date: "2026-07-29"
summary: "See how an agent moves from a request to structured arguments, a mydoclist result, and a response you can review."
html_url: /library/learn/how-tool-calls-work
markdown_url: /library/learn/how-tool-calls-work.md
---

# How tool calls work

See how an agent moves from a request to structured arguments, a mydoclist result, and a response you can review.

**By the end:** You can tell whether an agent used a tool, distinguish a tool result from the agent’s explanation, and recover from permissions or validation errors.

Agent Fundamentals · 14 min · Practical

## A model cannot reach into mydoclist by itself

A language model produces language. A tool gives the AI application a controlled way to ask another system to read information or perform an action. Without an available mydoclist tool, the model cannot truthfully claim it searched your book or logged a visit.

The tool has a name, a description, an input schema, permissions, and a structured result. The agent chooses the tool and prepares arguments; mydoclist validates and executes the request as the signed-in user.

## One tool call, end to end

This simplified trace shows the boundary between conversation, structured execution, and explanation.

1. **1 · User request**: `“Find Cherry Creek Example Cardiology in my book.”`. Natural-language outcome and scope.
2. **2 · Tool selection**: `tool: search_book`. The model selects an available read tool whose description matches the job.
3. **3 · Structured arguments**: `{ "query": "Cherry Creek Example Cardiology" }`. The application validates named fields and types before execution.
4. **4 · Structured result**: `{ "matches": [{ "site_id": "…", "name": "Cherry Creek Example Cardiology" }] }`. mydoclist returns stable identity and authorized CRM data.
5. **5 · Conversational response**: `“I found one matching practice in your book.”`. The model translates the result into useful language without becoming the source of record.

## Not every tool has the same effect

The important distinction is not “AI versus no AI.” It is whether the tool reads, drafts, or commits.

- **Read**: Search or load authorized information without changing CRM state.
- **Draft**: Prepare a proposed activity or record change for inspection.
- **Confirm**: Ask the user to authorize the staged effect.
- **Commit**: mydoclist applies the validated change as the signed-in user.

## Availability is part of the answer

> **Check this:** Tool availability depends on the client, account, connection, and permission. To connect Claude, follow the steps at /connect-claude. If a tool is not visible in your conversation, use the linked web workflow rather than asking the model to imitate a tool call.

## Ask what the agent actually used

Use this after a factual lookup or before approving a consequential action.

Prompt `inspect-tool-use`:

> For the {{task}} you just completed, tell me:
> 1. Which tools you called, in order
> 2. Which facts came directly from tool results
> 3. Which statements are your interpretation
> 4. Whether any change is drafted, awaiting confirmation, or committed
> 5. Any permission, validation, or missing-data issue I should review
>
> Do not claim a mydoclist lookup if no mydoclist tool was available.

- {{task}} (Task): pre-call account lookup

## Logging a visit should be a staged write

**Situation:** A rep dictates a parking-lot note and asks the agent to log the visit with a Thursday follow-up.

**Input:**

> Log today’s office visit at Foothill Example Cardiology. I spoke with the office manager about the device line; she wants the reimbursement one-pager. Follow up Thursday.

**Expected output:**

- The agent resolves the practice identity rather than relying only on the spoken name.
- A write tool validates activity type, date, notes, and follow-up fields.
- The proposed change is returned as a draft with a confirmation boundary.
- Only the confirm step commits the activity; a conversational “done” is not evidence of a committed write.

**Takeaway:** Structured writes protect the record: the note is not buried in prose, the practice keeps a stable ID, and the rep sees the effect before it lands.

## Review the tool boundary

A polished conversational response is not proof that the right tool ran or that a write was committed.

- Was the correct tool available and selected?
- Did the arguments identify the right practice, person, and date?
- Does the structured result support the conversational summary?
- Is the action read-only, drafted, awaiting confirmation, or committed?
- Did the tool report a partial result or permission error?

## Tool errors are useful signals

- **The agent answers from general knowledge instead of calling a tool.**
  Likely cause: No tool was available, the request did not clearly require current data, or the model selected poorly.
  Recovery: Ask it to use the named mydoclist tool and report the source. If the tool is unavailable, open the web workflow.
- **The tool rejects the arguments.**
  Likely cause: A required field is missing, the value has the wrong type, or identity is ambiguous.
  Recovery: Read the validation message, provide the missing value, and retry. Do not ask the agent to guess a provider ID or date.
- **The tool reports that permission is denied.**
  Likely cause: The signed-in user or plan does not authorize that data or action.
  Recovery: Do not work around the boundary. Use an authorized workflow or ask the workspace administrator.

## Related modules

- [The mydoclist + AI partnership](mydoclist-ai-partnership.md): Learn what mydoclist, your AI application, and you each contribute to the work.
- [How context works](how-context-works.md): Understand what an agent can see now, what persists elsewhere, and how to supply only the context a field job needs.
- [Structured inputs and structured responses](structured-inputs-and-responses.md): See how ordinary field language becomes validated tool arguments, durable CRM fields, and a conversational explanation.
- [Log a visit and capture follow-up](log-visit-and-follow-up.md): Turn a fresh parking-lot note into a reviewable activity and a follow-up you can find when it matters.
- [How mydoclist connects to Claude and ChatGPT](how-mydoclist-connects-to-claude-and-chatgpt.md): See what an MCP connection makes available, how current data travels through it, and why every proposed CRM change still stops for your review.
