Skip to main content
Glama

get_session_voice

Retrieve your current session's assigned voice character to identify the active VOICEVOX speaker for text-to-speech synthesis.

Instructions

このセッションで使用する音声を取得(セッション毎に固定)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Tool handler for 'get_session_voice' - handles the tool call, invokes sessionVoice.getSessionVoice(), and returns the voice information with session metadata
    case "get_session_voice": {
      try {
        const sessionInfo = await sessionVoice.getSessionVoice();
        const voices = await voicevox.getVoices();
        const selectedVoice = voices.find((v) => v.id === sessionInfo.voiceId);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                voice: selectedVoice,
                sessionInfo: sessionInfo.sessionInfo,
              }, null, 2),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `エラー: ${
                error instanceof Error ? error.message : "不明なエラー"
              }`,
            },
          ],
        };
      }
    }
  • Core implementation of getSessionVoice() - initializes session voice and returns voice ID with session metadata (start time, duration, client ID)
    async getSessionVoice(): Promise<{
      voiceId: number;
      sessionInfo: {
        startTime: number;
        durationMs: number;
        clientId: string;
      };
    }> {
      const voiceId = await this.initializeSession();
    
      return {
        voiceId,
        sessionInfo: {
          startTime: this.sessionStartTime,
          durationMs: Date.now() - this.sessionStartTime,
          clientId: this.sharedState.getClientId(),
        },
      };
    }
  • src/index.ts:130-137 (registration)
    Tool registration for 'get_session_voice' - defines the tool name, description, and empty input schema in the tools list
    {
      name: "get_session_voice",
      description: "このセッションで使用する音声を取得(セッション毎に固定)",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },
  • Helper method initializeSession() - selects and registers a voice for the session using SharedStateManager, falls back to default voice on error
    async initializeSession(): Promise<number> {
      if (this.sessionVoiceId !== undefined) {
        return this.sessionVoiceId;
      }
    
      try {
        // 利用可能な全音声を取得
        const allVoices = await this.voicevox.getVoices();
        const availableVoiceIds = allVoices.map((voice) => voice.id);
    
        // 音声の選択と登録をアトミックに実行
        this.sessionVoiceId = await this.sharedState.selectAndRegisterVoice(
          availableVoiceIds,
          this.defaultVoiceId,
        );
    
        return this.sessionVoiceId;
      } catch (error) {
        console.error("Failed to initialize session voice:", error);
        // エラー時はデフォルト音声を使用
        this.sessionVoiceId = this.defaultVoiceId;
        return this.sessionVoiceId;
      }
    }
Behavior3/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. It successfully discloses idempotency/consistency via 'fixed per session,' but fails to describe the return format, potential side effects, or what happens if no voice is assigned.

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?

Single efficient sentence with action front-loaded ('音声を取得') and critical behavioral context deferred to a parenthetical. Zero redundancy—every character 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?

While the core purpose is clear, the absence of an output schema means the description should ideally characterize the return value (voice ID, name, object structure). As a simple getter, it is minimally viable but not comprehensive.

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 tool accepts zero parameters (empty schema), establishing a baseline of 4. The description requires no parameter clarification, though it implicitly confirms no filtering or input is needed to retrieve the session voice.

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 retrieves (取得) the voice (音声) assigned to the current session (このセッション), with the parenthetical 'fixed per session' (セッション毎に固定) effectively distinguishing it from sibling tools like get_random_unused_voice and list_voices.

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 'fixed per session' constraint implies this returns a persistent/deterministic value versus alternatives, but lacks explicit guidance on when to prefer this over get_random_unused_voice or list_voices, and omits any prerequisites or error conditions.

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/arrow2nd/vv-mcp'

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