Skip to main content
Glama

timecard_get_projects

Retrieve available projects from TimeCard MCP to manage timesheet entries, enabling selection of project IDs for activity lookup and hour tracking.

Instructions

Get list of available projects. Returns project id and name.

Use the project id with timecard_get_activities to get activity options, and with timecard_save to set entries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for the timecard_get_projects tool, which fetches available project options using the provided TimeCardSession.
    handler: async (args, session: TimeCardSession) => {
      const authResult = await session.ensureAuthenticated();
      if (!authResult.success) {
        throw new Error(authResult.message);
      }
    
      try {
        const projects = await session.getProjectOptions();
    
        return {
          projects: projects.map(p => ({
            id: p.id,
            name: p.name,
            description: p.name
          })),
          count: projects.length
        };
      } catch (error) {
        throw new Error(`Failed to get projects: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Registration of the timecard_get_projects tool in the dataTools array.
    timecardGetProjects,
  • Input schema definition for timecard_get_projects.
    inputSchema: {
      type: 'object',
      properties: {}
    },

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/keith-hung/timecard-mcp'

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