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
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session ID containing the generation | |
| generationId | Yes | Generation ID to share |
Implementation Reference
- src/tools/shares.ts:13-24 (handler)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 }; } }, - src/tools/shares.ts:9-12 (schema)The input schema for 'share-create' tool.
{ sessionId: z.string().describe("Session ID containing the generation"), generationId: z.string().describe("Generation ID to share"), }, - src/tools/shares.ts:6-25 (registration)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 }; } }, );