Documentation
¶
Index ¶
- Variables
- type ActivationResult
- type DateRange
- type DaySummary
- type FindAndUpdateEntryData
- type IdentityData
- type LogTimeData
- type ProjectSummary
- type QuickReportData
- type ResultEnvelope
- type Service
- func (s *Service) AddEntry(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) AddUserToGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ArchiveProjects(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateClient(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateCustomField(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateHoliday(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateProject(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateProjectTemplate(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateTag(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateTask(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateUserGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateUserGroupAdmin(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CreateWebhook(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) CurrentUser(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) DeactivateUser(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteCustomField(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteEntry(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteHoliday(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteUserGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteUserGroupAdmin(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DeleteWebhook(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) DetailedReport(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) EmitProgress(ctx context.Context, progress, total float64, message string)
- func (s *Service) FindAndUpdateEntry(ctx context.Context, args map[string]any) (any, error)
- func (s *Service) GetCustomField(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) GetEntry(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) GetProject(ctx context.Context, projectRef string) (ResultEnvelope, error)
- func (s *Service) GetProjectTemplate(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) GetUserGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) GetWebhook(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) GetWorkspace(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) ListClients(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListCustomFields(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListEntries(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListHolidays(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) ListProjectTemplates(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) ListProjects(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListResourceTemplates(_ context.Context) ([]mcp.ResourceTemplate, error)
- func (s *Service) ListResources(ctx context.Context) ([]mcp.Resource, error)
- func (s *Service) ListTags(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListTasks(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListUserGroups(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListUserGroupsAdmin(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) ListUsers(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListWebhookEvents(ctx context.Context, _ map[string]any) (ResultEnvelope, error)
- func (s *Service) ListWebhooks(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ListWorkspaces(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) LogTime(ctx context.Context, args map[string]any) (any, error)
- func (s *Service) PolicyInfo(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) QuickReport(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ReadResource(ctx context.Context, uri string) ([]mcp.ResourceContents, error)
- func (s *Service) Registry() []mcp.ToolDescriptor
- func (s *Service) RemoveUserFromGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ResolveDebug(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) ResolveWorkspaceID(ctx context.Context) (string, error)
- func (s *Service) SearchTools(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) SetCustomFieldValue(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) SetProjectMemberships(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) StartTimer(ctx context.Context, projectID, projectRef, description string) (ResultEnvelope, error)
- func (s *Service) StopTimer(ctx context.Context, args map[string]any) (any, error)
- func (s *Service) SummaryReport(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) SwitchProject(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) TestWebhook(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) Tier2Handlers(groupName string) ([]mcp.ToolDescriptor, bool)
- func (s *Service) TimerStatus(ctx context.Context) (ResultEnvelope, error)
- func (s *Service) TodayEntries(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateCustomField(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateEntry(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateProjectEstimate(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateUserGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateUserGroupAdmin(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateUserRole(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) UpdateWebhook(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) WeeklySummary(ctx context.Context, args map[string]any) (ResultEnvelope, error)
- func (s *Service) WhoAmI(ctx context.Context) (ResultEnvelope, error)
- type SummaryData
- type SummaryTotals
- type Tier2Group
- type WeeklySummaryData
- type WorkspaceContext
Constants ¶
This section is empty.
Variables ¶
var Tier2Groups = map[string]Tier2Group{}
Tier2Groups is the global registry of Tier 2 tool groups.
Functions ¶
This section is empty.
Types ¶
type ActivationResult ¶ added in v0.6.0
type DaySummary ¶
type FindAndUpdateEntryData ¶
type IdentityData ¶ added in v0.6.0
type LogTimeData ¶ added in v0.6.0
type ProjectSummary ¶
type QuickReportData ¶
type QuickReportData struct {
Range DateRange `json:"range"`
Totals SummaryTotals `json:"totals"`
TopProject *ProjectSummary `json:"topProject,omitempty"`
RunningEntries []clockify.TimeEntry `json:"runningEntries,omitempty"`
EntriesSample []clockify.TimeEntry `json:"entriesSample,omitempty"`
ProjectsRepresented int `json:"projectsRepresented"`
}
type ResultEnvelope ¶
type Service ¶
type Service struct {
Client *clockify.Client
WorkspaceID string
DefaultTimezone *time.Location // from CLOCKIFY_TIMEZONE; nil = system timezone
DedupeConfig *dedupe.Config // optional, set during wiring
PolicyDescribe func() map[string]any // set during wiring; returns policy description
ActivateGroup func(context.Context, string) (ActivationResult, error)
ActivateTool func(context.Context, string) (ActivationResult, error)
// Notifier delivers server→client notifications (progress, resource updates,
// etc.) emitted by tool handlers. nil = drop silently.
Notifier mcp.Notifier
// EmitResourceUpdate publishes notifications/resources/updated for a URI
// with an optional delta envelope. Wired from runtime.go to
// Server.NotifyResourceUpdated so the subscription gate lives in the
// protocol core rather than in every mutation handler. nil = drop silently
// (tests without a Server wired).
EmitResourceUpdate func(uri string, delta mcp.ResourceUpdateDelta)
// ReportMaxEntries is the hard cap on the number of time entries a report
// tool will aggregate. 0 disables the cap. Wired from CLOCKIFY_REPORT_MAX_ENTRIES.
ReportMaxEntries int
// contains filtered or unexported fields
}
func (*Service) AddUserToGroup ¶
AddUserToGroup adds a user to a user group.
func (*Service) ArchiveProjects ¶
func (*Service) CreateClient ¶ added in v0.6.0
func (*Service) CreateCustomField ¶
func (*Service) CreateHoliday ¶
func (*Service) CreateProject ¶ added in v0.6.0
func (*Service) CreateProjectTemplate ¶
func (*Service) CreateTask ¶ added in v0.6.0
func (*Service) CreateUserGroup ¶
CreateUserGroup creates a new user group.
func (*Service) CreateUserGroupAdmin ¶
func (*Service) CreateWebhook ¶
CreateWebhook creates a new webhook with URL validation.
func (*Service) CurrentUser ¶
func (s *Service) CurrentUser(ctx context.Context) (ResultEnvelope, error)
func (*Service) DeactivateUser ¶
DeactivateUser deactivates a user. Supports dry-run (confirm pattern).
func (*Service) DeleteCustomField ¶
func (*Service) DeleteEntry ¶
DeleteEntry deletes a time entry by ID.
func (*Service) DeleteHoliday ¶
func (*Service) DeleteUserGroup ¶
DeleteUserGroup deletes a user group. Supports dry-run (minimal fallback).
func (*Service) DeleteUserGroupAdmin ¶
func (*Service) DeleteWebhook ¶
DeleteWebhook deletes a webhook. Supports dry-run (preview via GET).
func (*Service) DetailedReport ¶
func (*Service) EmitProgress ¶
EmitProgress publishes a notifications/progress if a progressToken was supplied with the current tools/call and the Service has a Notifier wired. No-op otherwise. total < 0 signals an indeterminate total.
func (*Service) FindAndUpdateEntry ¶
func (*Service) GetCustomField ¶
func (*Service) GetProject ¶
func (*Service) GetProjectTemplate ¶
func (*Service) GetUserGroup ¶
func (*Service) GetWebhook ¶
GetWebhook retrieves a single webhook by ID.
func (*Service) GetWorkspace ¶
func (s *Service) GetWorkspace(ctx context.Context) (ResultEnvelope, error)
func (*Service) ListClients ¶ added in v0.6.0
func (*Service) ListCustomFields ¶
func (*Service) ListEntries ¶
ListEntries returns recent time entries with optional filtering by date range, project, and pagination.
func (*Service) ListHolidays ¶
func (s *Service) ListHolidays(ctx context.Context) (ResultEnvelope, error)
func (*Service) ListProjectTemplates ¶
func (s *Service) ListProjectTemplates(ctx context.Context) (ResultEnvelope, error)
func (*Service) ListProjects ¶ added in v0.6.0
func (*Service) ListResourceTemplates ¶
ListResourceTemplates returns the five parametric URI templates clients can dereference by substituting concrete IDs.
func (*Service) ListResources ¶
ListResources returns a small, immediately-navigable set of concrete resources pinned to the Service's current workspace. Parametric resources (per-id entry, project, weekly report) live in ListResourceTemplates.
func (*Service) ListUserGroups ¶
ListUserGroups returns user groups for the workspace.
func (*Service) ListUserGroupsAdmin ¶
func (s *Service) ListUserGroupsAdmin(ctx context.Context) (ResultEnvelope, error)
func (*Service) ListWebhookEvents ¶
ListWebhookEvents returns the available webhook event types.
func (*Service) ListWebhooks ¶
ListWebhooks returns webhooks for the workspace.
func (*Service) ListWorkspaces ¶ added in v0.6.0
func (s *Service) ListWorkspaces(ctx context.Context) (ResultEnvelope, error)
func (*Service) PolicyInfo ¶ added in v0.6.0
func (s *Service) PolicyInfo(ctx context.Context) (ResultEnvelope, error)
func (*Service) QuickReport ¶
func (*Service) ReadResource ¶
ReadResource parses a clockify:// URI and fetches the underlying entity from Clockify, returning it as a single JSON-encoded ResourceContents entry. Unknown or malformed URIs return a -32602-equivalent error.
func (*Service) Registry ¶ added in v0.6.0
func (s *Service) Registry() []mcp.ToolDescriptor
func (*Service) RemoveUserFromGroup ¶
func (s *Service) RemoveUserFromGroup(ctx context.Context, args map[string]any) (ResultEnvelope, error)
RemoveUserFromGroup removes a user from a user group. Supports dry-run (minimal fallback).
func (*Service) ResolveDebug ¶ added in v0.6.0
func (*Service) ResolveWorkspaceID ¶
func (*Service) SearchTools ¶ added in v0.6.0
func (*Service) SetCustomFieldValue ¶
func (*Service) SetProjectMemberships ¶
func (*Service) StartTimer ¶
func (*Service) SummaryReport ¶
func (*Service) SwitchProject ¶
func (*Service) TestWebhook ¶
TestWebhook sends a test delivery to a webhook.
func (*Service) Tier2Handlers ¶ added in v0.6.0
func (s *Service) Tier2Handlers(groupName string) ([]mcp.ToolDescriptor, bool)
Tier2Handlers returns the descriptors for a named Tier 2 group. Every returned descriptor has its Tool.OutputSchema populated with at least envelopeOpaque so MCP clients see a consistent envelope shape across all 91 lazy-loaded tools.
func (*Service) TimerStatus ¶
func (s *Service) TimerStatus(ctx context.Context) (ResultEnvelope, error)
func (*Service) TodayEntries ¶ added in v0.6.0
TodayEntries returns time entries for the current day.
func (*Service) UpdateCustomField ¶
func (*Service) UpdateEntry ¶
UpdateEntry performs a fetch-then-update of a time entry, merging caller fields over the existing values.
func (*Service) UpdateProjectEstimate ¶
func (*Service) UpdateUserGroup ¶
UpdateUserGroup updates a user group's name.
func (*Service) UpdateUserGroupAdmin ¶
func (*Service) UpdateUserRole ¶
UpdateUserRole updates a user's workspace role.
func (*Service) UpdateWebhook ¶
UpdateWebhook updates an existing webhook.
func (*Service) WeeklySummary ¶
type SummaryData ¶ added in v0.6.0
type SummaryData struct {
Range DateRange `json:"range"`
Totals SummaryTotals `json:"totals"`
ByProject []ProjectSummary `json:"byProject"`
Entries []clockify.TimeEntry `json:"entries,omitempty"`
}
type SummaryTotals ¶
type Tier2Group ¶ added in v0.6.0
type Tier2Group struct {
Name string
Description string
Keywords []string
Builder func(s *Service) []mcp.ToolDescriptor
}
Tier2Group defines a lazily-activated group of related tools.
type WeeklySummaryData ¶
type WeeklySummaryData struct {
Range DateRange `json:"range"`
Totals SummaryTotals `json:"totals"`
ByDay []DaySummary `json:"byDay"`
ByProject []ProjectSummary `json:"byProject"`
Entries []clockify.TimeEntry `json:"entries,omitempty"`
UnassignedKey string `json:"unassignedKey,omitempty"`
}
type WorkspaceContext ¶ added in v0.6.0
type WorkspaceContext struct {
WorkspaceID string `json:"workspaceId"`
}
Source Files
¶
- clients.go
- common.go
- context.go
- entries.go
- output_schemas.go
- projects.go
- registry.go
- reports.go
- resource_cache.go
- resources.go
- schemagen.go
- tags.go
- tasks.go
- tier2_approvals.go
- tier2_catalog.go
- tier2_custom_fields.go
- tier2_expenses.go
- tier2_groups_holidays.go
- tier2_invoices.go
- tier2_project_admin.go
- tier2_scheduling.go
- tier2_shared_reports.go
- tier2_time_off.go
- tier2_user_admin.go
- tier2_webhooks.go
- timer.go
- users.go
- workflows.go
- workspaces.go