Skip to main content
Glama

create_manual_activity

Log a workout manually in Garmin Connect when no device data is available, by specifying activity name, type, start time, duration, and optional distance.

Instructions

Create a manual activity entry. Use get_activity_types to find valid activityTypeKey values

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityNameYesName for the activity (e.g. "Morning Run")
activityTypeKeyYesActivity type key (e.g. running, cycling, swimming). Use get_activity_types to see all options
startTimeInGMTYesStart time in ISO 8601 format in GMT (e.g. "2024-01-15T08:30:00.000")
elapsedDurationInSecsYesDuration in seconds
distanceInMetersNoDistance in meters. Optional

Implementation Reference

  • The handler function that registers the 'create_manual_activity' tool. It calls client.createManualActivity with the validated inputs (activityName, activityTypeKey, startTimeInGMT, elapsedDurationInSecs, distanceInMeters) and returns the result as JSON.
    server.registerTool(
      'create_manual_activity',
      {
        description:
          'Create a manual activity entry. Use get_activity_types to find valid activityTypeKey values',
        inputSchema: createManualActivitySchema.shape,
      },
      async ({ activityName, activityTypeKey, startTimeInGMT, elapsedDurationInSecs, distanceInMeters }) => {
        const data = await client.createManualActivity({
          activityName,
          activityTypeKey,
          startTimeInGMT,
          elapsedDurationInSecs,
          distanceInMeters,
        });
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Zod schema 'createManualActivitySchema' defining input validation for create_manual_activity. Fields: activityName (string), activityTypeKey (string), startTimeInGMT (ISO 8601 string), elapsedDurationInSecs (positive number), distanceInMeters (optional non-negative number).
    export const createManualActivitySchema = z.object({
      activityName: z.string().describe('Name for the activity (e.g. "Morning Run")'),
      activityTypeKey: z.string().describe('Activity type key (e.g. running, cycling, swimming). Use get_activity_types to see all options'),
      startTimeInGMT: z
        .string()
        .describe('Start time in ISO 8601 format in GMT (e.g. "2024-01-15T08:30:00.000")'),
      elapsedDurationInSecs: z.number().positive().describe('Duration in seconds'),
      distanceInMeters: z.number().min(0).optional().describe('Distance in meters. Optional'),
    });
  • Registration of 'create_manual_activity' tool via server.registerTool() in the registerWriteTools function.
    server.registerTool(
      'create_manual_activity',
      {
        description:
          'Create a manual activity entry. Use get_activity_types to find valid activityTypeKey values',
        inputSchema: createManualActivitySchema.shape,
      },
      async ({ activityName, activityTypeKey, startTimeInGMT, elapsedDurationInSecs, distanceInMeters }) => {
        const data = await client.createManualActivity({
          activityName,
          activityTypeKey,
          startTimeInGMT,
          elapsedDurationInSecs,
          distanceInMeters,
        });
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • The GarminClient.createManualActivity method that sends a POST request to ACTIVITY_ENDPOINT + '/manual' with the payload (activityName, activityTypeKey, startTimeInGMT, elapsedDurationInSecs, distanceInMeters).
    async createManualActivity(payload: {
      activityName: string;
      activityTypeKey: string;
      startTimeInGMT: string;
      elapsedDurationInSecs: number;
      distanceInMeters?: number;
    }): Promise<unknown> {
      return this.request(`${ACTIVITY_ENDPOINT}/manual`, {
        method: 'POST',
        body: payload,
      });
    }
  • Constant ACTIVITY_ENDPOINT = '/activity-service/activity' used to construct the URL for creating manual activities.
    export const ACTIVITY_ENDPOINT = '/activity-service/activity';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action 'Create', but does not describe side effects, return value, error handling, or whether the operation is idempotent. This is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with one critical follow-up instruction. It is extremely concise with no filler or redundant information, and every part serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, no output schema, and no annotations, the description is too brief. It omits crucial context such as what constitutes a 'manual activity', what response to expect upon success, and potential error conditions. A more complete description would address these gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 5 parameters have descriptions in the input schema (100% coverage). The description adds value by referencing get_activity_types for activityTypeKey, which supplements the schema's enum-like hint. This extra context goes beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Create a manual activity entry' with a specific verb and resource. It distinguishes itself from sibling getter tools and other mutation tools like delete_activity or set_activity_name by focusing on creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance to use get_activity_types for valid activityTypeKey values, which is a prerequisite. It implicitly indicates when to use (to create manual activities), but does not state when not to use or mention alternatives, though no direct alternative exists among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/Nicolasvegam/garmin-connect-mcp'

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