Skip to main content
Glama

share-create

Generate public links for AI-generated content to share artifacts from sessions with others.

Instructions

Create a shareable public link for a generation's artifacts. Returns a slug and public URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID containing the generation
generationIdYesGeneration ID to share

Implementation Reference

  • The handler function for 'share-create' which calls client.shares.create.
    async (params) => {
      try {
        const result = await client.shares.create({
          sessionId: params.sessionId,
          generationId: params.generationId,
        } as any);
        return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
      }
    },
  • The input schema for 'share-create' tool.
    {
      sessionId: z.string().describe("Session ID containing the generation"),
      generationId: z.string().describe("Generation ID to share"),
    },
  • The registration of 'share-create' tool within the MCP server.
    server.tool(
      "share-create",
      "Create a shareable public link for a generation's artifacts. Returns a slug and public URL.",
      {
        sessionId: z.string().describe("Session ID containing the generation"),
        generationId: z.string().describe("Generation ID to share"),
      },
      async (params) => {
        try {
          const result = await client.shares.create({
            sessionId: params.sessionId,
            generationId: params.generationId,
          } as any);
          return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
        } catch (err) {
          const message = err instanceof Error ? err.message : String(err);
          return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
        }
      },
    );

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/ebenezer-isaac/llmconveyors-mcp'

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