Skip to content

search_elements

Search Elements · read tool

Find Elements whose qualified id or name contains the query, or the Service behind a URL or host (a Deployment’s url or an endpoint; a longer URL below one also matches). Case-insensitive. Exact matches come first, then prefixes, then the rest, each by id. A URL match carries the Deployment it matched.

Field Type Required Notes
query string yes
kind "person" or "system" or "service" or "component"
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
query string yes
total number yes
truncated boolean yes
elements list of object yes
elements[].id string yes
elements[].kind "person" or "system" or "service" or "component" yes
elements[].name string yes
elements[].owner string yes
elements[].parent string or null yes
elements[].deployment object
elements[].viewerUrl string

Called over the Kitchen sink example Workspace.

Arguments:

{
"query": "orders",
"limit": 3
}

Result:

{
"query": "orders",
"total": 2,
"truncated": false,
"elements": [
{
"id": "sink:orders",
"kind": "component",
"name": "Orders",
"owner": "core",
"parent": "sink:api"
},
{
"id": "sink:orders-db",
"kind": "service",
"name": "Orders DB",
"owner": "data",
"parent": "sink:shop"
}
]
}

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.
  • source_unavailable when the server can’t read the Workspace.
  • history_unavailable when the Workspace has no history to read at at.

Error codes says what to do about each.

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