Skip to main content
Glama

slides_generate

Generate presentation slides from text input using 2slides.com's API. Specify theme and language to create slides with job tracking for download.

Instructions

Generate slides with 2slides. Returns job info including jobId and downloadUrl when ready. Optional 'mode' can be 'sync' (default) or 'async'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
themeIdYes
userInputYes
responseLanguageYes
modeNo

Implementation Reference

  • Handler function that destructures args, makes a POST request to the 2slides API to generate slides, handles the response, and returns JSON data or error.
    async (args: any, _extra: any) => {
      const { themeId, userInput, responseLanguage, mode = 'sync' } = args as z.infer<z.ZodObject<typeof GenerateArgs>>;
      const url = `${API_BASE_URL}/api/v1/slides/generate`;
      const res = await fetch(url, {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ themeId, userInput, responseLanguage, mode }),
      });
    
      const data = await res.json();
      if (!res.ok) {
        return {
          content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
          isError: true,
        };
      }
      return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
    }
  • Zod schema defining input parameters for the slides_generate tool: themeId, userInput, responseLanguage, and optional mode.
    const GenerateArgs = {
      themeId: z.string().min(1),
      userInput: z.string().min(1),
      responseLanguage: z.string().min(1),
      // Optional mode: 'sync' (default) | 'async'
      mode: z.enum(['sync', 'async']).optional(),
    };
  • src/server.ts:29-54 (registration)
    Registration of the slides_generate tool using mcp.tool, including name, description, schema, and handler.
    mcp.tool(
      'slides_generate',
      "Generate slides with 2slides. Returns job info including jobId and downloadUrl when ready. Optional 'mode' can be 'sync' (default) or 'async'.",
      GenerateArgs,
      async (args: any, _extra: any) => {
        const { themeId, userInput, responseLanguage, mode = 'sync' } = args as z.infer<z.ZodObject<typeof GenerateArgs>>;
        const url = `${API_BASE_URL}/api/v1/slides/generate`;
        const res = await fetch(url, {
          method: 'POST',
          headers: {
            Authorization: `Bearer ${API_KEY}`,
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({ themeId, userInput, responseLanguage, mode }),
        });
    
        const data = await res.json();
        if (!res.ok) {
          return {
            content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
            isError: true,
          };
        }
        return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
      }
    );
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. It discloses that the tool returns job info (jobId and downloadUrl) and mentions sync/async modes, adding some behavioral context. However, it lacks details on permissions, rate limits, error handling, or what '2slides' entails, leaving gaps in transparency for a generation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the main purpose and key return info, followed by an optional parameter note. It's concise with two sentences, but could be slightly improved by integrating the mode explanation more seamlessly or adding brief context for other parameters.

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 no annotations, no output schema, and 4 parameters with 0% schema coverage, the description is incomplete. It covers the tool's purpose and return values partially, but misses details on parameter meanings, error cases, and full behavioral traits, making it only minimally viable for a generation tool with multiple inputs.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It only explains the 'mode' parameter with enum values, but doesn't add meaning for 'themeId', 'userInput', or 'responseLanguage'. This leaves three out of four parameters without semantic clarification, failing to adequately compensate for the low schema coverage.

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 action ('Generate slides with 2slides') and resource ('slides'), specifying it's a generation tool. However, it doesn't differentiate from sibling tools like 'jobs_get' or 'themes_search', which are retrieval tools rather than creation tools, so it misses explicit sibling distinction.

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 through the mention of 'mode' options ('sync' or 'async'), suggesting when to use based on timing preferences, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'jobs_get' for checking job status or 'themes_search' for finding themes, nor does it mention prerequisites or exclusions.

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/2slides/mcp-2slides'

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