Skip to main content
Glama

get_project_by_slug

Retrieve a WebSim project using the creator's username and project identifier to access specific content from the public API.

Instructions

Get a WebSim project by user and slug

Input Schema

NameRequiredDescriptionDefault
userYesUsername
slugYesProject slug

Input Schema (JSON Schema)

{ "properties": { "slug": { "description": "Project slug", "type": "string" }, "user": { "description": "Username", "type": "string" } }, "required": [ "user", "slug" ], "type": "object" }

Implementation Reference

  • MCP tool handler that validates input with UserSlugSchema, fetches project data via API client, and returns JSON-formatted response.
    handler: async (args) => { const { user, slug } = UserSlugSchema.parse(args); const result = await apiClient.getProjectBySlug(user, slug); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved project ${user}/${slug}` }, null, 2) }] }; }
  • Zod schema used for input validation in the get_project_by_slug handler.
    const UserSlugSchema = z.object({ user: z.string().describe('Username'), slug: z.string().describe('Project slug') });
  • server.js:267-298 (registration)
    Tool registration object in the tools array, defining name, description, input schema, and handler reference.
    { name: "get_project_by_slug", description: "Get a WebSim project by user and slug", inputSchema: { type: "object", properties: { user: { type: "string", description: "Username" }, slug: { type: "string", description: "Project slug" } }, required: ["user", "slug"] }, handler: async (args) => { const { user, slug } = UserSlugSchema.parse(args); const result = await apiClient.getProjectBySlug(user, slug); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved project ${user}/${slug}` }, null, 2) }] }; } },
  • WebSimAPIClient helper method that performs the HTTP request to retrieve project by user and slug.
    async getProjectBySlug(user, slug) { return this.makeRequest(`/api/v1/users/${user}/slugs/${slug}`); }

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/gigachadtrey/websimm'

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