Skip to main content
Glama

list_user_projects

Retrieve all projects created by a specific user in WebSim, with options to limit results and paginate through the list.

Instructions

List all projects for a specific user

Input Schema

NameRequiredDescriptionDefault
userYesUsername
limitNoNumber of projects to return (default: 20)
offsetNoNumber of projects to skip (default: 0)

Input Schema (JSON Schema)

{ "properties": { "limit": { "default": 20, "description": "Number of projects to return (default: 20)", "type": "number" }, "offset": { "default": 0, "description": "Number of projects to skip (default: 0)", "type": "number" }, "user": { "description": "Username", "type": "string" } }, "required": [ "user" ], "type": "object" }

Implementation Reference

  • The handler function that executes the tool logic: parses arguments using UserParamsSchema, calls the API client's listUserProjects method, and returns formatted JSON response as MCP content.
    handler: async (args) => { const { user, limit = 20, offset = 0 } = UserParamsSchema.parse(args); const result = await apiClient.listUserProjects(user, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} projects for user ${user}` }, null, 2) }] }; }
  • JSON Schema defining the input parameters for the list_user_projects tool, including user (required), limit, and offset.
    inputSchema: { type: "object", properties: { user: { type: "string", description: "Username" }, limit: { type: "number", description: "Number of projects to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of projects to skip (default: 0)", default: 0 } }, required: ["user"] },
  • server.js:332-369 (registration)
    The complete tool registration object for 'list_user_projects' added to the tools array used by the MCP server for listing and calling tools.
    { name: "list_user_projects", description: "List all projects for a specific user", inputSchema: { type: "object", properties: { user: { type: "string", description: "Username" }, limit: { type: "number", description: "Number of projects to return (default: 20)", default: 20 }, offset: { type: "number", description: "Number of projects to skip (default: 0)", default: 0 } }, required: ["user"] }, handler: async (args) => { const { user, limit = 20, offset = 0 } = UserParamsSchema.parse(args); const result = await apiClient.listUserProjects(user, limit, offset); return { content: [{ type: "text", text: JSON.stringify({ success: true, data: result, message: `Successfully retrieved ${result.items?.length || 0} projects for user ${user}` }, null, 2) }] }; } },
  • Helper method in WebSimAPIClient that makes the HTTP request to fetch a user's projects from the WebSim API.
    async listUserProjects(user, limit = 20, offset = 0) { const params = new URLSearchParams({ limit: limit.toString(), offset: offset.toString() }); return this.makeRequest(`/api/v1/users/${user}/projects?${params}`); }
  • Zod schema used in the tool handler for validating the 'user' input parameter.
    const UserParamsSchema = z.object({ user: z.string().describe('Username') });

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