Skip to main content
Glama

toggl_list_projects

Retrieve all project names and details from your Toggl workspace to organize time tracking data and manage tasks efficiently.

Instructions

List projects for a workspace

Input Schema

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

Implementation Reference

  • MCP tool handler for 'toggl_list_projects': extracts workspace_id from arguments (falling back to env default), calls TogglAPI.getProjects, formats response with project details (id, name, active, billable, color, client_id), and returns as JSON text content.
    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)
        }]
      };
    }
  • Tool schema definition: name, description, and input schema accepting optional workspace_id (number).
    {
      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)'
          }
        }
      },
    },
  • TogglAPI.getProjects: Makes authenticated GET request to Toggl API endpoint /workspaces/{workspaceId}/projects to fetch list of projects.
    async getProjects(workspaceId: number): Promise<Project[]> {
      return this.request<Project[]>('GET', `/workspaces/${workspaceId}/projects`);
    }

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