ActivityWatch MCP Server
{"swagger": "2.0", "basePath": "/api", "paths": {"/0/buckets/": {"get": {"responses": {"200": {"description": "Success"}}, "summary": "Get dict {bucket_name: Bucket} of all buckets", "operationId": "get_buckets_resource", "tags": ["default"]}}, "/0/buckets/{bucket_id}": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}], "delete": {"responses": {"200": {"description": "Success"}}, "summary": "Delete a bucket", "operationId": "delete_bucket_resource", "parameters": [{"in": "query", "description": "Needs to be =1 to delete a bucket it non-testing mode", "name": "force", "type": "string"}], "tags": ["default"]}, "put": {"responses": {"200": {"description": "Success"}}, "summary": "Update bucket metadata", "operationId": "put_bucket_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/UpdateBucket"}}], "tags": ["default"]}, "get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Bucket"}}}, "summary": "Get metadata about bucket", "operationId": "get_bucket_resource", "tags": ["default"]}, "post": {"responses": {"200": {"description": "Success"}}, "summary": "Create a bucket", "description": "If hostname is \"!local\", the hostname and device_id will be set from the server info.\nThis is useful for watchers which are known/assumed to run locally but might not know their hostname (like aw-watcher-web).\n\nReturns True if successful, otherwise false if a bucket with the given ID already existed.", "operationId": "post_bucket_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/CreateBucket"}}], "tags": ["default"]}}, "/0/buckets/{bucket_id}/events": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}], "post": {"responses": {"200": {"description": "Success"}}, "summary": "Create events for a bucket", "description": "Can handle both single events and multiple ones.\n\nReturns the inserted event when a single event was inserted, otherwise None.", "operationId": "post_events_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/Event"}}], "tags": ["default"]}, "get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Event"}}}, "summary": "Get events from a bucket", "operationId": "get_events_resource", "parameters": [{"in": "query", "description": "End date of events", "name": "end", "type": "string"}, {"in": "query", "description": "Start date of events", "name": "start", "type": "string"}, {"in": "query", "description": "the maximum number of requests to get", "name": "limit", "type": "string"}], "tags": ["default"]}}, "/0/buckets/{bucket_id}/events/count": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"200": {"description": "Success", "schema": {"type": "integer"}}}, "summary": "Get eventcount from a bucket", "operationId": "get_event_count_resource", "parameters": [{"in": "query", "description": "End date of eventcount", "name": "end", "type": "string"}, {"in": "query", "description": "Start date of eventcount", "name": "start", "type": "string"}], "tags": ["default"]}}, "/0/buckets/{bucket_id}/events/{event_id}": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}, {"name": "event_id", "in": "path", "required": true, "type": "integer"}], "delete": {"responses": {"200": {"description": "Success"}}, "summary": "Delete a single event from a bucket", "operationId": "delete_event_resource", "tags": ["default"]}, "get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Event"}}}, "summary": "Get a single event from a bucket", "operationId": "get_event_resource", "tags": ["default"]}}, "/0/buckets/{bucket_id}/export": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}], "get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Export"}}}, "summary": "Export a bucket to a dataformat consistent across versions, including all events in it", "operationId": "get_bucket_export_resource", "tags": ["default"]}}, "/0/buckets/{bucket_id}/heartbeat": {"parameters": [{"name": "bucket_id", "in": "path", "required": true, "type": "string"}], "post": {"responses": {"200": {"description": "Success"}}, "summary": "Heartbeats are useful when implementing watchers that simply keep", "description": "track of a state, how long it's in that state and when it changes.\nA single heartbeat always has a duration of zero.\n\nIf the heartbeat was identical to the last (apart from timestamp), then the last event has its duration updated.\nIf the heartbeat differed, then a new event is created.\n\nSuch as:\n - Active application and window title\n - Example: aw-watcher-window\n - Currently open document/browser tab/playing song\n - Example: wakatime\n - Example: aw-watcher-web\n - Example: aw-watcher-spotify\n - Is the user active/inactive?\n Send an event on some interval indicating if the user is active or not.\n - Example: aw-watcher-afk\n\nInspired by: https://wakatime.com/developers#heartbeats", "operationId": "post_heartbeat_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/Event"}}, {"in": "query", "description": "Largest timewindow allowed between heartbeats for them to merge", "name": "pulsetime", "type": "string"}], "tags": ["default"]}}, "/0/export": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Export"}}}, "summary": "Exports all buckets and their events to a format consistent across versions", "operationId": "get_export_all_resource", "tags": ["default"]}}, "/0/import": {"post": {"responses": {"200": {"description": "Success"}}, "operationId": "post_import_all_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/Export"}}], "tags": ["default"]}}, "/0/info": {"get": {"responses": {"200": {"description": "Success", "schema": {"$ref": "#/definitions/Info"}}}, "summary": "Get server info", "operationId": "get_info_resource", "parameters": [{"name": "X-Fields", "in": "header", "type": "string", "format": "mask", "description": "An optional fields mask"}], "tags": ["default"]}}, "/0/log": {"get": {"responses": {"200": {"description": "Success"}}, "summary": "Get the server log in json format", "operationId": "get_log_resource", "tags": ["default"]}}, "/0/query/": {"post": {"responses": {"200": {"description": "Success"}}, "operationId": "post_query_resource", "parameters": [{"name": "payload", "required": true, "in": "body", "schema": {"$ref": "#/definitions/Query"}}, {"in": "query", "description": "Name of the query (required if using cache)", "name": "name", "type": "string"}], "tags": ["default"]}}, "/0/settings": {"post": {"responses": {"200": {"description": "Success"}}, "operationId": "post_settings_resource", "tags": ["default"]}, "get": {"responses": {"200": {"description": "Success"}}, "operationId": "get_settings_resource", "tags": ["default"]}}, "/0/settings/{key}": {"parameters": [{"name": "key", "in": "path", "required": true, "type": "string"}], "post": {"responses": {"200": {"description": "Success"}}, "operationId": "post_settings_resource", "tags": ["default"]}, "get": {"responses": {"200": {"description": "Success"}}, "operationId": "get_settings_resource", "tags": ["default"]}}}, "info": {"title": "API", "version": "1.0"}, "produces": ["application/json"], "consumes": ["application/json"], "tags": [{"name": "default", "description": "Default namespace"}], "definitions": {"Info": {"properties": {"hostname": {"type": "string"}, "version": {"type": "string"}, "testing": {"type": "boolean"}, "device_id": {"type": "string"}}, "type": "object"}, "UpdateBucket": {"properties": {"client": {"type": "string"}, "type": {"type": "string"}, "hostname": {"type": "string"}, "data": {"type": "string"}}, "type": "object"}, "CreateBucket": {"required": ["client", "hostname", "type"], "properties": {"client": {"type": "string"}, "type": {"type": "string"}, "hostname": {"type": "string"}}, "type": "object"}, "Bucket": {"$id": "https://activitywatch.net/schemas/bucket.v0.json", "$schema": "http://json-schema.org/draft-04/schema#", "title": "Bucket", "description": "The Bucket model that is used in ActivityWatch", "type": "object", "required": ["id", "type", "client", "hostname"], "properties": {"id": {"description": "The unique id for the bucket", "type": "string"}, "name": {"description": "The readable and renameable name for the bucket", "type": "string"}, "type": {"description": "The event type", "type": "string"}, "client": {"description": "The name of the client that is reporting to the bucket", "type": "string"}, "hostname": {"description": "The hostname of the machine on which the client is running", "type": "string"}, "created": {"description": "The creation datetime of the bucket", "type": "string", "format": "date-time"}, "data": {"description": "", "type": "object"}, "events": {"type": "array", "items": {"$ref": "#/definitions/Event"}}}}, "Event": {"$schema": "http://json-schema.org/draft-04/schema#", "title": "Event", "description": "The Event model that is used in ActivityWatch", "type": "object", "required": ["timestamp"], "properties": {"timestamp": {"type": "string", "format": "date-time"}, "duration": {"type": "number"}, "data": {"type": "object"}}}, "Query": {"required": ["query", "timeperiods"], "properties": {"timeperiods": {"type": "array", "description": "List of periods to query", "items": {"type": "string"}}, "query": {"type": "array", "description": "String list of query statements", "items": {"type": "string"}}}, "type": "object"}, "Export": {"$id": "https://activitywatch.net/schemas/export.v0.json", "$schema": "http://json-schema.org/draft-04/schema#", "title": "Export", "description": "The Export model that is used by ActivityWatch", "type": "object", "required": [], "properties": {"buckets": {"type": "array", "items": {"$ref": "#/definitions/Bucket"}}}}}, "responses": {"ParseError": {"description": "When a mask can't be parsed"}, "MaskError": {"description": "When any error occurs on mask"}}}