/function-calling

Function calling for voice-agent pronunciation scoring

Expose assessment as a well-defined function in your existing agent stack. Keep score calculation deterministic, then let the model explain only the fields and actions your product approves.

/Contract first

Give the model a narrow, reliable tool

A focused function definition helps the agent know when assessment is appropriate and what information it must provide.

  • Define language, reference text, task type and audio input clearly
  • Validate tool arguments before sending an assessment request
  • Return stable fields instead of prose-only results
  • Keep scoring and thresholds outside free-form model reasoning
Clean function-definition panel for assess_speech floating above an agent chat transcript
/Grounded feedback

Let the LLM explain evidence, not invent it

Select the returned words, phonemes, tones or fluency signals that matter, then ask the model to turn them into concise coaching.

  • Cite the exact problem segment in the user response
  • Prioritize repeated or meaning-changing errors before generating advice
  • Limit advice to the most important one or two corrections
  • Ask for a retry when audio quality is insufficient
  • Preserve raw results for analytics without exposing them in the UI
Voice-agent UI citing a specific phoneme tip pulled from a structured assessment result
/Operational safety

Design the failure path before the happy path scales

Production voice agents need explicit behavior for missing audio, unsupported tasks, timeouts and uncertain results.

  • Use schema validation and deterministic error handling
  • Set retry, timeout and spend policies at the application layer
  • Record tool latency and failure categories
  • Route sensitive or high-stakes cases to appropriate human review
Engineering ops view showing timeout, retry and spend-limit policies for a speech tool
/choose-your-integration

MCP server or function calling?

Both use the same Chivox speech-assessment capability. The right choice depends on where the tool should live and how much of the agent loop your application controls.

Current page · Function calling
CompareMCP server

Standardized tool layer for compatible clients.

Function calling

Typed function inside your own agent stack.

Best-fit scenarioExpose the same speech tools to MCP-compatible clients and agent environments.Add speech assessment inside a custom voice agent or an existing LLM workflow.
Best-fit teamsDeveloper-tool teams, platform teams, and products supporting several MCP clients.Voice-agent teams, AI application engineers, and product teams with their own orchestration layer.
Integration styleConfigure one standardized MCP server that publishes discoverable assessment tools.Define and invoke a typed function contract in your chosen model or agent SDK.
PortabilityHigher across compatible MCP clients; the tool definition stays consistent.Depends on the provider or framework, but fits deeply into a custom application loop.
Application controlThe client discovers and calls tools while your server controls assessment behavior and output.Your application directly controls validation, routing, retries, thresholds, and response handling.
Choose it when…You want the fastest reusable path into MCP ecosystems or need one tool layer for several clients.You already own the agent loop and need precise control over when and how assessment runs.
You can support both: use MCP for compatible clients and function calling inside your proprietary agent, while keeping one shared assessment service underneath.
/show-not-tell

One tool call inside your agent loop

The model hands over the audio, gets back structured scores, and explains the result from evidence — numbers it can cite, not vibes it has to invent.

agent-loop.ts
// The model called your assess_speech tool — your handler runs the scoring:
const result = await chivox.callTool("en_sentence_eval", {
  ref_text: "An apple a day.",
  audio_url: "https://cdn.example.com/take-01.mp3",
});

// → { overall: 85, accuracy: 82, pron: 88,
//     fluency: { overall: 78, speed: 65 },
//     details: [ /* per-word, per-phoneme rows */ ] }
/workflow

A guarded function call inside the agent loop

Validate before assessment, keep product thresholds deterministic and let the model explain only the evidence you approve.

  1. 01
    Model selects the assessment function

    A narrow tool schema tells the model when assessment applies and what it must supply.

  2. 02
    Application validates arguments

    Reject missing audio, wrong languages and unsupported task types before spending an assessment call.

  3. 03
    Chivox returns speech evidence

    Stable fields — overall, accuracy, pron, fluency and details[] — arrive as deterministic JSON.

  4. 04
    Agent explains an approved next step

    Coaching cites the returned evidence; pass/fail thresholds stay in your own code.

/implementation-brief

Decisions to make before the tool call

Two practical questions that keep the model, product rules and assessment service in the right roles.

01

How is function calling different from MCP?

Function calling describes the tool contract inside a particular agent stack. MCP provides a standardized way to expose tools to compatible clients. Both can use the same assessment capability.

02

Should the model decide pass or fail?

Product thresholds and high-impact decisions should remain deterministic. The model is best used to explain approved evidence and guide the next interaction.

/contact

Let’s build your voice agent together.

Tell us what you’re building. We’ll reply within one business day with pilot credits, pricing, or a deployment plan — whichever you need first.