Skip to main content

manage_audio

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: core  ·  Module: services.tools.manage_audio

Maturity: stable (support status; independent of enabled state, readiness and permissions).

Description​

Diagnose observed scene audio state without proving output-device audibility; inspect or explicitly set existing mixer-group routing; read/apply per-platform AudioImporter policies. Routing records Undo and dirties the scene; saving the scene is separate. Importer policy saves/reimports and reads native settings back; reimport may limit Undo. Play or stop an existing scene AudioSource in Play mode. Play requires an active, enabled source and a usable AudioClip; optionally supply a clip asset path under Assets/ or Packages/. Stop also supports inactive, disabled or clipless sources. No component is created. A successful response confirms the request was issued, not audible output. Omit search_method for automatic ID, path or name resolution.

Parameters​

NameTypeRequiredDescription
actionLiteral['play', 'stop', 'diagnose', 'get_routing', 'set_routing', 'read_import_settings', 'apply_import_settings']yesAudio observation, explicit routing/import policy, or playback action.
targetstr | intyesScene GameObject name, hierarchy path or integer instance ID. Importer actions instead require an AudioClip asset path under Assets/.
clipstr | None—Optional AudioClip asset path for play only; omit to use the source's current clip.
search_methodLiteral['by_id', 'by_name', 'by_path', 'by_id_or_name_or_path'] | None—Target selector. Omitted or null uses automatic ID, path or name resolution.
mixer_pathstr | None—get_routing inventory or set_routing existing AudioMixer asset path.
group_idstr | None—set_routing exact persistent group local file ID from get_routing inventory; never a first-name match.
clear_routingbool—set_routing explicit reset to the default output; excludes mixer_path/group_id.
platformstr | None—Importer platform: Default (omitted) or a Unity BuildTargetGroup name, e.g. Standalone, Android, iOS. Names are case-insensitive. Reuse the returned platform on later calls. Values without an override are Unity-translated defaults.
settingsAudioImportPolicy | None—
clear_overridebool—apply_import_settings removes the selected platform override; excludes settings and Default platform.
unity_instancestr | int | None—Target Unity instance for this call: Name@hash or hash prefix; an integer selects only that exact port over stdio and is rejected over HTTP. Read mcpforunity://instances for available targets. Omit to use the legacy active selection or the sole available instance.

Returns​

A dict containing the Unity response. The exact shape depends on the action.

Examples​

Inspect the playback and listener state for a specific scene AudioSource. Replace Music with the relevant object. The result describes what Unity observes, including whether the source is playing.

MCP arguments
{
"action": "diagnose",
"target": "Music",
"search_method": "by_name"
}