Skip to main content
Glama

toggl_list_projects

Retrieve all projects from a Toggl Track workspace to manage and organize time tracking activities efficiently.

Instructions

List projects for a workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspace_idNoWorkspace ID (uses default if not provided)

Implementation Reference

  • Handler for the 'toggl_list_projects' tool. Validates workspace ID, calls TogglAPI.getProjects, and formats the response as JSON with project details.
    case 'toggl_list_projects': { const workspaceId = args?.workspace_id || defaultWorkspaceId; if (!workspaceId) { throw new Error('Workspace ID required (set TOGGL_DEFAULT_WORKSPACE_ID or provide workspace_id)'); } const projects = await api.getProjects(workspaceId as number); return { content: [{ type: 'text', text: JSON.stringify({ workspace_id: workspaceId, count: projects.length, projects: projects.map(p => ({ id: p.id, name: p.name, active: p.active, billable: p.billable, color: p.color, client_id: p.client_id })) }, null, 2) }] }; }
  • Schema definition for the 'toggl_list_projects' tool, including input schema for optional workspace_id.
    { name: 'toggl_list_projects', description: 'List projects for a workspace', inputSchema: { type: 'object', properties: { workspace_id: { type: 'number', description: 'Workspace ID (uses default if not provided)' } } }, },
  • Helper method in TogglAPI that performs the HTTP GET request to retrieve projects for the specified workspace.
    async getProjects(workspaceId: number): Promise<Project[]> { return this.request<Project[]>('GET', `/workspaces/${workspaceId}/projects`); }
  • src/index.ts:386-388 (registration)
    Registration handler for listing all tools, including 'toggl_list_projects' via the tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { 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/verygoodplugins/mcp-toggl'

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