Skip to content

Add line.push_audio tool #4

Description

@harleyjj

Labels: enhancement, tools, good first issue

Summary

We have line.push_image but not line.push_audio. Add it for parity. Useful for voice replies, generated audio, or short clips.

API reference

Audio message type

{
  "type": "audio",
  "originalContentUrl": "https://example.com/voice.m4a",
  "duration": 60000
}
  • originalContentUrl: HTTPS URL to m4a audio (max 200MB).
  • duration: length in milliseconds.

What to implement

Add pushAudio: "line.push_audio" to TOOL_NAMES. Add tool definition:

{
  name: TOOL_NAMES.pushAudio,
  displayName: "LINE Push Audio",
  description: "Send an audio message (m4a) to a LINE principal.",
  parametersSchema: {
    type: "object",
    properties: {
      lineUserId: { type: "string" },
      audioUrl: { type: "string" },
      durationMs: { type: "integer", minimum: 1 }
    },
    required: ["lineUserId", "audioUrl", "durationMs"]
  }
}

Worker handler: build the message and reuse the existing pushToLine path.

Acceptance criteria

  • Tool registered, tested
  • Push limit accounting
  • Test in tests/push-tools.test.ts
  • README tool table updated

Notes

  • Only m4a is officially supported by LINE clients. Other audio formats may render as "unsupported message" on some clients.
  • LINE's iOS/Android client plays the audio inline; web doesn't always.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions