Skip to main content
Glama
balloonf

Windows TTS MCP Server

by balloonf

speak_short

Convert short text (up to 100 characters) into speech instantly using Windows' built-in Speech API for quick and efficient auditory communication.

Instructions

짧은 텍스트를 즉시 읽어줍니다 (100자 이하)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes

Implementation Reference

  • Main handler for 'speak_short' tool. Validates text length (<=100 chars), spawns daemon thread to execute TTS via powershell_tts.
    @mcp.tool()
    def speak_short(text: str) -> str:
        """짧은 텍스트를 즉시 읽어줍니다 (100자 이하)"""
        try:
            if len(text) > 100:
                return "[ERROR] 텍스트가 너무 깁니다. speak를 사용하세요."
            
            def _speak_short():
                powershell_tts(text)
            
            thread = threading.Thread(target=_speak_short, daemon=True)
            thread.start()
            
            return f"[SHORT] 짧은 텍스트 재생: '{text}'"
            
        except Exception as e:
            return f"[ERROR] 짧은 텍스트 재생 오류: {str(e)}"
  • Core helper function that performs the actual TTS synthesis using PowerShell's System.Speech.Synthesis. Manages subprocess execution, threading locks for process tracking, timeouts, and error recovery. Called by speak_short.
    def powershell_tts(text: str, rate: int = 0, volume: int = 100) -> bool:
        """PowerShell을 사용한 TTS 실행"""
        process = None
        try:
            if platform.system() != "Windows":
                safe_print("[ERROR] Windows가 아닙니다")
                return False
            
            # 텍스트에서 작은따옴표 이스케이프 처리
            escaped_text = text.replace("'", "''")
            
            # PowerShell TTS 명령어
            cmd = [
                "powershell", "-Command",
                f"Add-Type -AssemblyName System.Speech; "
                f"$synth = New-Object System.Speech.Synthesis.SpeechSynthesizer; "
                f"$synth.Rate = {rate}; "
                f"$synth.Volume = {volume}; "
                f"$synth.Speak('{escaped_text}'); "
                f"$synth.Dispose()"
            ]
            
            # 프로세스 시작
            process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
            
            # 실행 중인 프로세스 목록에 추가
            with process_lock:
                running_processes.append(process)
            
            # 프로세스 완료 대기
            stdout, stderr = process.communicate(timeout=180)
            
            # 완료된 프로세스 목록에서 제거
            with process_lock:
                if process in running_processes:
                    running_processes.remove(process)
            
            if process.returncode == 0:
                safe_print(f"[SUCCESS] TTS 완료: {text[:30]}...")
                return True
            else:
                safe_print(f"[ERROR] TTS 오류: {stderr}")
                return False
                
        except subprocess.TimeoutExpired:
            safe_print("[WARNING] TTS 시간 초과")
            if process:
                process.kill()
                with process_lock:
                    if process in running_processes:
                        running_processes.remove(process)
            return False
        except Exception as e:
            safe_print(f"[ERROR] TTS 예외: {e}")
            if process:
                try:
                    process.kill()
                    with process_lock:
                        if process in running_processes:
                            running_processes.remove(process)
                except:
                    pass
            return False
  • Global variables for managing running TTS processes and thread-safe locking, used by powershell_tts and other TTS functions including speak_short.
    # 실행 중인 TTS 프로세스 관리
    running_processes = []
    process_lock = threading.Lock()
  • FastMCP decorator that registers the speak_short function as a tool.
    @mcp.tool()
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 mentions '즉시' (immediately), hinting at low latency, but doesn't cover other important aspects like whether this requires audio output permissions, how errors are handled, or if it interrupts other speech. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence in Korean that conveys the core functionality and key constraint. It's front-loaded with the main action and includes the critical character limit without any unnecessary words. Every part of the sentence earns its place.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is adequate but not complete. It covers the basic purpose and parameter constraint but lacks details on behavioral traits, error handling, or output format. For a simple tool, it meets minimum viability but could be more informative.

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

Parameters4/5

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

The description adds meaningful context for the single parameter 'text' by specifying it must be '짧은 텍스트' (short text) with a '100자 이하' (100 characters or less) limit. Since schema description coverage is 0% (no descriptions in the schema), this compensates well by clarifying the parameter's constraints beyond just its type, though it doesn't detail format or encoding.

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

Purpose4/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: '짧은 텍스트를 즉시 읽어줍니다 (100자 이하)' translates to 'Reads short text immediately (100 characters or less)'. This specifies the verb ('reads'), resource ('short text'), and scope ('100 characters or less'), making it clear what the tool does. It doesn't explicitly distinguish from siblings like 'speak', 'speak_fast', etc., but the character limit provides some differentiation.

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 context through the character limit ('100자 이하' meaning 100 characters or less), suggesting this tool is for short texts. However, it doesn't provide explicit guidance on when to use this versus alternatives like 'speak' or 'speak_fast', nor does it mention exclusions or prerequisites. The implied context is helpful but incomplete.

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

Related 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/balloonf/widows_tts_mcp'

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