Skip to main content
Glama

assess_pronunciation

Analyze pronunciation accuracy by comparing spoken audio to reference text. Provides detailed scores and phoneme-level feedback to identify areas for improvement.

Instructions

Assess how accurately a speaker pronounced the given text.

Returns an overall pronunciation score (0-100), per-word scores, and phoneme-level feedback including accuracy, fluency, and completeness.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe reference text the user should have read aloud
audio_base64YesBase64-encoded audio of the user reading the text (WAV or MP3)
languageNoLanguage code, e.g. 'en-US', 'pt-BR', 'es-ES'en-US

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.py:51-71 (handler)
    The main handler function for the 'assess_pronunciation' tool. It takes text, base64-encoded audio, and language code as inputs, makes an async POST request to the Brainiall API endpoint '/v1/pronunciation/assess', and returns a JSON response with pronunciation scores including overall score (0-100), per-word scores, and phoneme-level feedback.
    async def assess_pronunciation(
        text: Annotated[str, "The reference text the user should have read aloud"],
        audio_base64: Annotated[str, "Base64-encoded audio of the user reading the text (WAV or MP3)"],
        language: Annotated[str, "Language code, e.g. 'en-US', 'pt-BR', 'es-ES'"] = "en-US",
    ) -> dict:
        """Assess how accurately a speaker pronounced the given text.
    
        Returns an overall pronunciation score (0-100), per-word scores,
        and phoneme-level feedback including accuracy, fluency, and completeness.
        """
        async with _client() as client:
            response = await client.post(
                "/v1/pronunciation/assess",
                json={
                    "text": text,
                    "audio_base64": audio_base64,
                    "language": language,
                },
            )
            response.raise_for_status()
            return response.json()
  • Input schema definition using Annotated type hints. Defines three parameters: 'text' (required reference text), 'audio_base64' (required base64-encoded audio in WAV or MP3 format), and 'language' (optional with default 'en-US').
        text: Annotated[str, "The reference text the user should have read aloud"],
        audio_base64: Annotated[str, "Base64-encoded audio of the user reading the text (WAV or MP3)"],
        language: Annotated[str, "Language code, e.g. 'en-US', 'pt-BR', 'es-ES'"] = "en-US",
    ) -> dict:
  • server.py:50-50 (registration)
    Tool registration using the @mcp.tool() decorator from FastMCP framework, which registers the function as an MCP tool named 'assess_pronunciation'.
    @mcp.tool()
  • Helper function _client() that creates and returns an httpx.AsyncClient configured with the API base URL, authorization headers, and 60-second timeout for making HTTP requests to the Brainiall API.
    def _client() -> httpx.AsyncClient:
        return httpx.AsyncClient(
            base_url=API_BASE,
            headers=_headers,
            timeout=60.0,
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the output (scores and feedback) but does not cover critical behavioral aspects such as performance characteristics (e.g., latency, rate limits), error handling, or authentication requirements. This leaves gaps in understanding how the tool behaves in practice beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by a concise summary of return values. Both sentences earn their place by providing essential information without redundancy, making it efficient and well-structured for quick understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists, the description does not need to detail return values, and it adequately covers the tool's function. However, with no annotations and a mutation-like operation (assessment implies processing), it could benefit from more behavioral context (e.g., performance notes). The description is mostly complete but has minor gaps in transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (text, audio_base64, language) with clear descriptions. The description does not add any additional meaning or context beyond what the schema provides, such as explaining parameter interactions or constraints. Baseline 3 is appropriate as the schema handles the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Assess') and resource ('pronunciation'), specifying what it evaluates (accuracy of pronunciation against given text). It distinguishes itself from sibling tools like transcribe_speech (which converts speech to text) and synthesize_speech (which generates speech), focusing on assessment rather than transcription or synthesis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning what the tool returns (scores and feedback), but does not explicitly state when to use it versus alternatives like transcribe_speech or list_voices. It provides context through the return values but lacks explicit guidance on scenarios or exclusions, such as when audio quality might affect results.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fasuizu-br/brainiall-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server