Skip to main content
Glama

Log time

log_time

Log work hours against a work package or project, validated against OpenProject rules for allowed activities and permissions. Returns the created time entry.

Instructions

Book time against a work package or a project.

Use it when the user says "log 2 hours on #1234" or "book half a day to project X". The call is validated through OpenProject's own form endpoint first, so an activity this project does not allow, a missing permission or a closed cost-reporting period comes back as a typed error listing what would be accepted — nothing half-written is left behind.

Returns the created entry: {id, hours, spent_on, comment, user, activity, work_package, project, created_at, updated_at, lock_version}. hours comes back as a float.

Pitfalls. This is not idempotent — calling it twice books the time twice, so never blind-retry after a timeout; list the day's entries first. The time is always booked for the token owner; you cannot log time on someone else's behalf through this tool. Logging time does not change the work package's status, estimate or progress — those are separate fields, and on instances that derive progress from work the percentage is read-only anyway. The work package's spent_hours reflects the new entry on the next read.

Cross-references: the activities and ids this project accepts come from get_project_metadata(project_id=...); review what is already booked with list_time_entries; fix a mistake with update_time_entry or delete_time_entry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hoursYesDuration in hours as a float: 1.5 is one and a half hours, 0.25 is fifteen minutes. Must be positive; OpenProject stores it to the minute.
commentNoWhat the time was spent on. Short and factual: it shows up in cost reports next to the hours.
activityNoActivity name ('Development') or numeric id. Omit to take the instance default from the form. Names are resolved against this project's allowed activities; an unknown name fails with the valid ones listed.
spent_onYesThe date the work was done, ISO YYYY-MM-DD. Required and never inferred — 'today' on the server may not be today for the user.
project_idNoProject to book the time on when the work belongs to no single ticket (numeric id or identifier). Required when work_package_id is omitted.
work_package_idNoWork package to book the time on. Ids come from search_work_packages or list_work_packages. Either this or project_id is required; passing both books on the work package inside that project.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoTime entry id. Feed it to update_time_entry or delete_time_entry.
userNoUser the time is booked for.
hoursNoLogged duration in hours as a float (1.5 = one and a half hours), converted from OpenProject's ISO 8601 duration.
commentNoFree-text comment as entered (raw); html is dropped.
projectNoProject the entry belongs to.
activityNoTime-entry activity (Development, Management, …); instance-defined.
spent_onNoThe date the work was done, ISO YYYY-MM-DD.
created_atNoISO 8601 UTC timestamp.
updated_atNoISO 8601 UTC timestamp.
lock_versionNoOptimistic-locking version, when this instance reports one for time entries; null means the resource is updated without a lock version.
work_packageNoWork package the time is booked on; null for project-level entries.
Behavior5/5

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

The description goes beyond the annotations by explicitly stating 'This is not idempotent', 'time is always booked for the token owner', and that logging time does not change the work package's status, estimate, or progress. It also details the form-endpoint validation and typed error behavior, providing valuable safety context.

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 well-structured and front-loaded with the core action, followed by usage triggers, a 'Pitfalls' section, and cross-references. Although it is long, each section is purposeful, and the use of paragraphs and labels keeps it scannable without wasting words.

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

Completeness5/5

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

Given the tool's complexity (6 parameters, 2 required, mutation semantics), the description is remarkably complete. It covers validation and error handling, return format, ownership constraints, non-idempotence, and related tools. The output schema is also explicitly described, so an agent has all necessary context for safe invocation.

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

Parameters3/5

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

The input schema already has 100% description coverage for all six parameters, including required ones like hours and spent_on. The description adds some helpful examples and cross-references (e.g., 'half a day' for hours, getting activity ids from get_project_metadata), but these are pragmatic touches rather than new parameter semantics beyond what the schema already provides.

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 opens with a clear, specific action: 'Book time against a work package or a project.' This immediately distinguishes it from siblings like list_time_entries, update_time_entry, and delete_time_entry, which all have different verbs and targets.

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

Usage Guidelines5/5

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

It provides explicit trigger examples ('Use it when the user says "log 2 hours on #1234" or "book half a day to project X"') and names alternatives for related operations: get_project_metadata for allowed activities, list_time_entries for reviewing booked time, and update_time_entry/delete_time_entry for corrections.

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/kar-thik/openproject-mcp'

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