Skip to main content
Glama

listUsers

Retrieve a complete list of all users within a Clockify workspace. This tool enables workspace admins to efficiently manage and review user access and roles.

Instructions

List all users in the workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The switch case that implements the core logic of the listUsers tool: fetches users from Clockify workspace API and formats response as JSON.
    case "listUsers": { const users = await clockifyFetch(`/workspaces/${workspaceId}/users`); return { content: [ { type: "text", text: JSON.stringify(users, null, 2), }, ], }; }
  • Tool schema definition for listUsers, provided by listToolsHandler, specifying name, description, and empty input schema.
    { name: "listUsers", description: "List all users in the workspace.", inputSchema: { type: "object", properties: {}, required: [] }, },
  • src/index.ts:43-43 (registration)
    Registers the listToolsHandler function, which exposes the listUsers tool schema to MCP clients.
    server.setRequestHandler(ListToolsRequestSchema, listToolsHandler);
  • src/index.ts:49-49 (registration)
    Registers the callToolHandler function, which handles execution of the listUsers tool via switch case.
    server.setRequestHandler(CallToolRequestSchema, callToolHandler);
  • Helper function used by listUsers handler to make authenticated API calls to Clockify.
    async function clockifyFetch(endpoint: string, options: RequestInit = {}) { const apiKey = getApiKey(); const baseUrl = "https://api.clockify.me/api/v1"; const url = endpoint.startsWith("http") ? endpoint : `${baseUrl}${endpoint}`; const headers = { "X-Api-Key": apiKey, "Content-Type": "application/json", ...(options.headers || {}), }; const response = await fetch(url, { ...options, headers }); if (!response.ok) { const text = await response.text(); console.error( `[Error] Clockify API ${url} failed: ${response.status} ${text}`, ); throw new Error(`Clockify API error: ${response.status} ${text}`); } return response.json(); }

Other Tools

Related 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/inakianduaga/clockify-mcp'

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