Skip to content

get_changes

Get Changes · read tool

What changed in the Model between two points in time, each a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone) (on a checkout, any git ref too): a flat list of Changes (added, removed or changed), each with the fields that differ and the whole item before and after. to defaults to at, else the Workspace the server is reading. scope narrows to an Element (with its descendants and the Relationships, Deployments and ADRs touching them), a Team (what it owns at either side) or a Project; pass scope_kind when a Team and a Project share the id. kinds keeps only some item kinds.

Field Type Required Notes
from string yes The point to compare from: a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone).
to string The point to compare to: a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone). Defaults to at, else the current Workspace.
scope string An Element (project:id), a Team id or a Project id.
scope_kind "element" or "team" or "project" What scope names, when a Team and a Project share the id.
kinds list of "team" or "environment" or "project" or "element" or "relationship" or "target" or "deployment" or "view" or "adr" Only these item kinds: team, environment, project, element, relationship, target, deployment, view, adr. At least 1 item.
limit integer The most items to return; truncated says whether there were more. Default: 50. At least 1. At most 9007199254740991.
at string A point in time to answer at: a tag, a commit sha or its first 4 or more characters, or a date (YYYY-MM-DD) or time (ISO 8601, UTC unless it gives a zone). On a checkout, any git ref works too. Leave out for the current Workspace.
Field Type Required Notes
from object yes
from.point string yes
from.commit string yes
to object yes
to.point string or null yes
to.commit string or null yes
scope object or null yes
scope.kind "element" or "team" or "project" yes What scope names, when a Team and a Project share the id.
scope.id string yes
total number yes
truncated boolean yes
counts map of id → object yes
counts.<id>.added number yes
counts.<id>.removed number yes
counts.<id>.changed number yes
changes list of object yes
changes[].type "added" or "removed" or "changed" yes
changes[].kind "team" or "environment" or "project" or "element" or "relationship" or "target" or "deployment" or "view" or "adr" yes
changes[].id string yes
changes[].fields list of string yes
changes[].before map of id → any or null yes
changes[].after map of id → any or null yes

Called over the Kitchen sink example Workspace.

Arguments:

{
"from": "737dd399d1b037ce5cd7a723138fc59fb90f6835",
"limit": 3
}

Result:

{
"from": {
"point": "737dd399d1b037ce5cd7a723138fc59fb90f6835",
"commit": "737dd399d1b037ce5cd7a723138fc59fb90f6835"
},
"to": {
"point": null,
"commit": "cd98671ee966749347a07735c221e6a30fc62a82"
},
"scope": null,
"total": 10,
"truncated": true,
"counts": {
"element": {
"added": 1,
"removed": 0,
"changed": 3
},
"relationship": {
"added": 1,
"removed": 0,
"changed": 0
},
"target": {
"added": 0,
"removed": 0,
"changed": 1
},
"deployment": {
"added": 0,
"removed": 0,
"changed": 1
},
"view": {
"added": 2,
"removed": 0,
"changed": 0
},
"adr": {
"added": 1,
"removed": 0,
"changed": 0
}
},
"changes": [
{
"type": "changed",
"kind": "element",
"id": "sink:api",
"fields": [
"description",
"metadata",
"repository"
],
"before": {
"id": "sink:api",
"kind": "service",
"parent": "sink:shop",
"name": "API",
"description": "An app Service with Components.",
"owner": "core",
"tags": [],
"links": [],
"metadata": {},
"type": "app",
"technology": "Node.js",
"external": false,
"repository": null
},
"after": {
"id": "sink:api",
"kind": "service",
"parent": "sink:shop",
"name": "API",
"description": "An app Service with Components. Its description is **Markdown**:\n\n- `orders` takes and charges orders\n- `catalogue` searches the catalog\n",
"owner": "core",
"tags": [],
"links": [],
"metadata": {
"tier": "1",
"on-call": "core-oncall",
"pci-scope": "true"
},
"type": "app",
"technology": "Node.js",
"external": false,
"repository": "https://github.com/sink-example/api"
}
},
{
"type": "changed",
"kind": "element",
"id": "sink:catalogue",
"fields": [
"name"
],
"before": {
"id": "sink:catalogue",
"kind": "component",
"parent": "sink:api",
"name": "Catalogue",
"description": null,
"owner": "core",
"tags": [],
"links": [],
"metadata": {},
"technology": "TypeScript module",
"repository": null
},
"after": {
"id": "sink:catalogue",
"kind": "component",
"parent": "sink:api",
"name": "Catalog",
"description": null,
"owner": "core",
"tags": [],
"links": [],
"metadata": {},
"technology": "TypeScript module",
"repository": null
}
},
{
"type": "added",
"kind": "element",
"id": "sink:reports",
"fields": [],
"before": null,
"after": {
"id": "sink:reports",
"kind": "service",
"parent": "sink:shop",
"name": "Reports",
"description": "A Service in Shop, declared outside the System's file.",
"owner": "data",
"tags": [],
"links": [],
"metadata": {},
"type": "app",
"technology": "Python",
"external": false,
"repository": null
}
}
]
}

A call that fails returns isError: true, with {code, message, suggestions?} as structuredContent. This tool returns:

  • invalid_input when the arguments don’t fit the input above.
  • not_found when an id or name, or the point in history given as at, matches nothing, or a sha prefix starts more than one Revision, with the candidates.
  • ambiguous when scope names both a Project and an Element; pass scope_kind.
  • source_unavailable when the server can’t read the Workspace.
  • history_unavailable when the Workspace has no history to read.

Error codes says what to do about each.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.