Skip to main content
Glama

play_sound

Play meme sounds and sound effects from myinstants.com through your speakers. Search by query, slug, or URL, and control playback timing for interactive audio experiences.

Instructions

Play a sound from myinstants.com. Returns the sound duration in seconds so you can plan around async playback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slugNoSound slug from search results
urlNoDirect MP3 URL
queryNoQuick search — plays first result
waitNoWait for sound to finish before returning (default: false). Set true only for dramatic moments where timing matters.

Implementation Reference

  • The "play_sound" MCP tool is defined and implemented here, handling sound retrieval (via slug, URL, or query) and playback using streamPlay or enqueue, and returning the duration.
    server.tool(
      "play_sound",
      "Play a sound from myinstants.com. Returns the sound duration in seconds so you can plan around async playback.",
      {
        slug: z.string().optional().describe("Sound slug from search results"),
        url: z.string().optional().describe("Direct MP3 URL"),
        query: z.string().optional().describe("Quick search — plays first result"),
        wait: z.boolean().optional().default(defaultWait).describe(`Wait for sound to finish before returning (default: ${defaultWait}). Set true only for dramatic moments where timing matters.`),
      },
      async ({ slug, url, query, wait }) => {
        let soundUrl = url;
        let name = url?.split("/").pop()?.replace(/\.\w+$/, "") || "";
    
        if (query) {
          const results = await search(query);
          if (!results.length) return { content: [{ type: "text", text: `No sounds found for "${query}"` }] };
          const q = query.toLowerCase();
          const best = results.find(r => r.name.toLowerCase() === q) || results[0];
          soundUrl = best.url;
          name = best.name;
        } else if (slug) {
          const html = await httpGet(`${BASE}/en/instant/${encodeURIComponent(slug)}/`);
          soundUrl = html.match(/<meta\s+(?:name|property)=["']og:audio["']\s+content=["']([^"']+)["']/)?.[1] || null;
          if (!soundUrl) return { content: [{ type: "text", text: `Sound "${slug}" not found` }] };
          name = (html.match(/<meta\s+(?:name|property)=["']og:title["']\s+content=["']([^"']+)["']/)?.[1] || "").replace(/\s*-\s*Sound Button$/i, "") || slug.replace(/-\d+$/, "").replace(/-/g, " ");
        }
    
        if (!soundUrl) return { content: [{ type: "text", text: "Provide slug, url, or query." }] };
    
        const [duration] = await Promise.all([
          getMp3Duration(soundUrl),
          wait ? streamPlay(soundUrl) : Promise.resolve(enqueue(soundUrl)),
        ]);
        const lines = [`🔊 ${name}`];
        if (duration) lines.push(`Duration: ${duration}s`);
        if (!wait && duration) lines.push(`Sound is playing in the background and will finish in ~${duration} seconds.`);
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by explaining the return behavior ('Returns the sound duration in seconds') and async nature ('plan around async playback'), but it lacks details on potential errors, rate limits, or authentication needs. It provides useful context but not comprehensive behavioral traits.

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 extremely concise and front-loaded, consisting of just two sentences that efficiently convey the tool's purpose and key behavioral detail. Every word earns its place, with no wasted text, making it easy for an agent to parse quickly.

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

Completeness4/5

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

Given the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is reasonably complete. It covers the purpose, return value, and async behavior, but it could improve by mentioning error handling or usage constraints. Without an output schema, it does explain the return type, which helps compensate.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description does not add any parameter-specific semantics beyond what the schema provides, such as explaining the relationships between slug, url, and query. It meets the baseline for high schema coverage but does not enhance parameter understanding.

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 specific action ('Play a sound from myinstants.com') and resource ('sound'), distinguishing it from sibling tools like browse_category and search_sounds which are for discovery rather than playback. It also specifies the return value ('Returns the sound duration in seconds'), making the purpose explicit and distinct.

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

Usage Guidelines4/5

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

The description provides clear context for usage ('so you can plan around async playback') and implies when to use it (for playing sounds rather than browsing or searching). However, it does not explicitly state when not to use it or name alternatives among the sibling tools, which prevents a perfect score.

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/austenstone/myinstants-mcp'

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