Skip to main content
Glama

transcribe_audio

Convert audio files to text with a local speech-to-text engine. Specify the file path, and optionally set language or model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the audio file to transcribe
languageNoISO-639-1 language code, e.g. 'en', 'fr'. Omit for auto-detect.
modelNoWhisper model ID to use. Defaults to Systran/faster-whisper-large-v3

Implementation Reference

  • src/index.js:25-64 (registration)
    Registers the 'transcribe_audio' tool on the MCP server with schema (file_path, language, model) and handler that reads an audio file and calls OpenAI-compatible speech-to-text API.
    server.tool(
      "transcribe_audio",
      {
        file_path: z.string().describe("Absolute path to the audio file to transcribe"),
        language: z
          .string()
          .optional()
          .describe("ISO-639-1 language code, e.g. 'en', 'fr'. Omit for auto-detect."),
        model: z
          .string()
          .optional()
          .describe(`Whisper model ID to use. Defaults to ${STT_MODEL}`),
      },
      async ({ file_path, language, model }) => {
        if (!fs.existsSync(file_path)) {
          return {
            content: [{ type: "text", text: `Error: file not found: ${file_path}` }],
            isError: true,
          };
        }
    
        let transcription;
        try {
          transcription = await client.audio.transcriptions.create({
            file: fs.createReadStream(file_path),
            model: model || STT_MODEL,
            ...(language ? { language } : {}),
          });
        } catch (err) {
          return {
            content: [{ type: "text", text: `Error: transcription failed: ${err.message}` }],
            isError: true,
          };
        }
    
        return {
          content: [{ type: "text", text: transcription.text }],
        };
      }
    );
  • Zod schema defining input parameters: required file_path, optional language (ISO-639-1), and optional model (Whisper model ID).
    {
      file_path: z.string().describe("Absolute path to the audio file to transcribe"),
      language: z
        .string()
        .optional()
        .describe("ISO-639-1 language code, e.g. 'en', 'fr'. Omit for auto-detect."),
      model: z
        .string()
        .optional()
        .describe(`Whisper model ID to use. Defaults to ${STT_MODEL}`),
  • Handler function that checks file existence, streams the audio file to the OpenAI-compatible STT API via client.audio.transcriptions.create, and returns the transcribed text.
    async ({ file_path, language, model }) => {
      if (!fs.existsSync(file_path)) {
        return {
          content: [{ type: "text", text: `Error: file not found: ${file_path}` }],
          isError: true,
        };
      }
    
      let transcription;
      try {
        transcription = await client.audio.transcriptions.create({
          file: fs.createReadStream(file_path),
          model: model || STT_MODEL,
          ...(language ? { language } : {}),
        });
      } catch (err) {
        return {
          content: [{ type: "text", text: `Error: transcription failed: ${err.message}` }],
          isError: true,
        };
      }
    
      return {
        content: [{ type: "text", text: transcription.text }],
      };
    }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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/xavier-hernandez/mcp-speaches'

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