Back to all posts
AI Agents7 min read·October 25, 2026

How to Design ERP and CRM Tools for AI Agents

TB
ThynkBlox AI Team
AI Engineering

Design ERP and CRM tools for AI agents around narrow business actions, such as finding an order or preparing a quote, with typed inputs and explicit constraints. Keep reads separate from writes, enforce permissions and business rules outside the agent, and return predictable results. The agent should choose among permitted actions; it should not need unrestricted access to a generic API to complete a routine workflow.

What should an agent tool represent?

Start with a business outcome that has a clear boundary. “Prepare a quote for an existing customer” is a useful boundary. “Send any request to the CRM” leaves the agent responsible for choosing endpoints, interpreting fields and deciding which changes are allowed.

For each tool, specify:

  • The action it performs and when to use it.
  • Required inputs, their types and allowed values.
  • Records and fields it may access.
  • Conditions that must hold before execution.
  • Changes it can make.
  • Results and errors it can return.

Keep the boundary meaningful. A tool that handles every sales operation is too broad to describe precisely. A separate tool for every field can make a simple task unnecessarily fragmented. Prefer one tool per coherent business action.

How should you separate reads from writes?

Make the distinction visible in the tool names, descriptions and permissions. A search should retrieve information without changing a business record. A write should describe its intended effect explicitly.

ToolPurposeSuggested boundary
Find customerReturn permitted customer matchesSelected summary fields only
Check order statusRead the current order stateNo order changes
Prepare quoteCreate a draft from approved productsNo sending or order creation
Submit approved quoteApply an authorised draftApproval tied to that exact draft
Check action statusResolve an uncertain write resultNo new write

These are suggested contracts, not a required catalogue.

Do not let a read tool silently create a customer when no match exists. Return “no match” and require an explicit creation action.

Also distinguish preparation from commitment. A draft quote, a sent quote and a confirmed order should have separate permissions and completion states. Decide what data an AI agent should be able to see before defining its search tools.

What belongs in typed inputs and explicit constraints?

Give each input a defined meaning. A customer reference should accept a customer identifier, not an arbitrary object or free-form query. A delivery method should accept a documented set of choices.

For amounts and quantities, define the representation, currency or unit, permitted precision and treatment of missing values. Never leave the agent to infer whether an amount represents major currency units or a smaller accounting unit.

Distinguish three checks:

  • Shape: Is a required field present and correctly typed?
  • Meaning: Does the referenced customer or product exist?
  • Permission and policy: May this caller perform this action on these records?

Enforce all three in the tool service. Instructions to the agent can explain the rules, but should not be the mechanism that enforces them.

Derive the organisation and acting identity from authenticated context. Do not accept them as unrestricted inputs that let the agent choose whose records to access.

What would a narrow quote tool look like?

Consider an illustrative workflow: a sales assistant prepares a quote for an existing customer.

The preparation tool could accept a customer reference and product lines. It would retrieve approved prices itself, validate the requested quantities and return a draft for review.

Contract elementIllustrative design
ActionPrepare a quote draft
InputsCustomer reference, product references, quantities and units
Excluded inputsArbitrary prices, approval flags and unrestricted record fields
ChecksCustomer access, product availability, valid units and current pricing
Success resultDraft reference, calculated lines, currency, total and review requirements
Business effectDraft created; nothing sent or confirmed

If negotiated pricing is necessary, define a separate, authorised pricing path. Do not add an unrestricted price override merely because the agent might encounter an exception.

The next action should name the draft and its version. If approval is required, bind it to that exact content. A changed customer, quantity or price should trigger fresh validation and any required approval.

How should validation handle changing records?

Validate against current business state when a write executes, even if the agent checked the record earlier.

For example, a customer may become inactive after quote preparation. A draft may also change after someone reviews it. Define what happens in those cases instead of letting the agent assume that an earlier check still applies.

Use a record version or equivalent change marker where relevant. If the supplied version is no longer current, return a conflict and require a fresh read.

For an action that must succeed as a whole, make that requirement explicit. If partial completion is permitted, report each completed and failed item separately. Never return an overall success that leaves the caller guessing which records changed.

What should predictable responses contain?

Use a stable response structure with a machine-readable status and a short explanation.

A successful write should identify the resulting record, its current state and whether the requested business action is complete. “Accepted for processing” should have a different status from “completed”.

For failures, define fields such as:

  • Code: A stable category the caller can handle.
  • Message: A clear explanation suitable for the intended reader.
  • Field: The relevant input, when applicable.
  • Retry guidance: Whether another attempt is appropriate.
  • Outcome: Whether anything changed.

Keep sensitive details out of error messages. An access denial should not reveal another customer's data or expose underlying system details.

Which errors should the agent handle differently?

Write an error contract before connecting the agent.

Error categoryMeaningExpected next step
Invalid inputA field fails the contractCorrect it or request missing information
Ambiguous matchSeveral permitted records matchAsk the user to choose
Policy rejectionThe requested action breaks a business ruleExplain the permitted next step
Access deniedThe caller lacks permissionStop that action
ConflictRelevant state has changedRead again and revalidate
Temporary failureThe service cannot complete the request nowFollow the defined retry policy
Outcome unknownA write may have completedCheck status before another attempt

Treat an unknown outcome separately from a confirmed failure. If a quote submission times out, the agent should check the original action's status before trying to submit again.

Give retried writes a request identifier with defined duplicate-handling behaviour. Specify its scope and reuse rules, including what happens if the same identifier arrives with different inputs.

Where should human approval sit?

Place approval immediately before the consequential action, after the proposed change is specific enough to review.

Show the approver the customer, affected records, proposed values and intended effect. Enforce the approval requirement in the write tool. The agent should not be able to satisfy it by passing an “approved” flag.

Record who approved what, and invalidate approval when material details change. Our guide to approval steps for AI agents explains how to place this boundary within a workflow.

What common mistakes should you avoid?

Wrapping a generic API without narrowing it. A tool that accepts any endpoint and payload still leaves the action boundary undefined.

Trusting the model to enforce policy. Keep access checks, allowed transitions and approval requirements in the service that performs the action.

Returning only prose. Give the agent structured results alongside readable explanations.

Retrying every failure. Correct invalid input, stop denied actions and resolve uncertain outcomes before repeating writes.

Hiding side effects. State whether an action sends a message, reserves stock or triggers another process.

A conversational agent may also be unnecessary for a fully specified workflow with no interpretation or choice. Use a direct integration when it meets the requirement more simply.

How do you know the tools are ready?

Before a pilot, verify that:

  • Every action has a defined effect and completion state.
  • Invalid inputs and unauthorised records are rejected.
  • Reads cannot trigger business writes.
  • Changed records invalidate stale assumptions.
  • Retries cannot silently duplicate the intended action.
  • Errors identify a safe next step.
  • Approval covers the exact change being applied.

Test these behaviours directly, then test whether the agent selects and uses the tools correctly. Define the decision criteria before starting, as described in how to run an AI pilot that ends in a decision.

Frequently asked questions

Does every API endpoint need an agent tool?

No. Expose the actions needed for the agreed workflow. Keep unrelated capabilities outside the agent's available tools.

Can one tool work across different ERP and CRM systems?

Yes, as a design choice, if each integration can honour the same contract. Document differences in supported actions and failure behaviour. Do not promise a shared capability that an underlying system cannot provide.

Should every write require approval?

Set approval requirements according to the action's consequences, reversibility and business policy. A permitted draft update may need different controls from sending a customer commitment. Enforce that distinction explicitly.


Our custom AI agent service starts with the workflow, permitted actions and review boundaries your business needs.

See what the Model Context Protocol means for business for how a shared standard connects agents to tools like these.

Ready when you are

Want to talk this through for your business?

Send us the process you are thinking about. You will hear back from an engineer, not a sales team.