Skip to main content
Glama

jobs_get

Retrieve slide generation job status and results from 2slides.com by providing a job ID. Monitor progress until completion.

Instructions

Get job status/result by jobId from 2slides. Please check every 20 seconds until the status is success.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYes

Implementation Reference

  • The handler function for the 'jobs_get' MCP tool. It takes a jobId, makes a GET request to the 2slides API to retrieve job status/result, and returns the JSON response or error.
    mcp.tool('jobs_get', 'Get job status/result by jobId from 2slides. Please check every 20 seconds until the status is success.', JobArgs, async (args: any, _extra: any) => {
        const { jobId } = args as z.infer<z.ZodObject<typeof JobArgs>>;
        const url = `${API_BASE_URL}/api/v1/jobs/${encodeURIComponent(jobId)}`;
        const res = await fetch(url, {
          method: 'GET',
          headers: {
            Authorization: `Bearer ${API_KEY}`,
            'Content-Type': 'application/json',
          },
        });
        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 for 'jobs_get' tool input parameters: requires a 'jobId' string.
    const JobArgs = { jobId: z.string().min(1) };
  • src/server.ts:59-77 (registration)
    Registration of the 'jobs_get' tool using mcp.tool(), including schema reference and inline handler.
    mcp.tool('jobs_get', 'Get job status/result by jobId from 2slides. Please check every 20 seconds until the status is success.', JobArgs, async (args: any, _extra: any) => {
        const { jobId } = args as z.infer<z.ZodObject<typeof JobArgs>>;
        const url = `${API_BASE_URL}/api/v1/jobs/${encodeURIComponent(jobId)}`;
        const res = await fetch(url, {
          method: 'GET',
          headers: {
            Authorization: `Bearer ${API_KEY}`,
            'Content-Type': 'application/json',
          },
        });
        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) }] };
    });
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