Skip to content

Tools Variables

Ryan James edited this page Aug 17, 2026 · 2 revisions

Variables tools

This page is generated from the code by scripts/gen_wiki_tools.py — do not edit by hand.

8 tools · category token variables · enable with DATAVERSE_TOOLS=variables (unset enables every category)

Tool-Index · Home

Every tool returns JSON. Errors return {"error": true, "message": "..."}. Write tools require DATAVERSE_ALLOW_WRITE=true; delete tools require DATAVERSE_ALLOW_DELETE=true.


dataverse_create_environment_variable

Write · non-idempotent · category variables

Create a new environment variable definition and optional initial value.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
schema_name str yes Schema name for the environment variable definition (e.g., 'new_MyVariable'). Must include a publisher prefix and be unique. (min_len=1, pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)
display_name str yes Display name for the environment variable. (min_len=1)
type int yes Data type of the environment variable. 100000000=String, 100000001=Number, 100000002=Boolean, 100000003=JSON, 100000004=Data source, 100000005=Secret. (ge=100000000, le=100000005)
default_value str | None no None Default value stored on the definition. Used when no environment-specific value record exists.
description str | None no None Description of the environment variable.
value str | None no None Initial current value to set. If provided, a bound environmentvariablevalue record is created immediately alongside the definition.
solution_unique_name str | None no None Unique name of the solution to associate the new definition with. Passed as the MSCRM.SolutionUniqueName request header. (pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)

Returns {"created": ..., "schema_name": ..., "display_name": ..., "environment_variable_definition_id": ..., "environment_variable_value_id": ..., "solution_unique_name": ...}.


dataverse_create_environment_variable_value

Write · non-idempotent · category variables

Create a new environment variable value record bound to a definition.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
definition_id str | None no None GUID of the environment variable definition to bind the new value to. Mutually exclusive with name. (min_len=36, max_len=36)
name str | None no None Schema name or display name of the environment variable definition. Schema name is tried first (exact match); display name is the fallback. Mutually exclusive with definition_id. (min_len=1)
value str yes The value to store in the new environmentvariablevalue record. (min_len=1)

dataverse_delete_environment_variable

Delete · idempotent · category variables

Delete an environment variable definition, its current value, or both.

Note: Only unmanaged environment variables can be deleted.

Note: Managed ones must be removed by uninstalling the owning solution.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
environment_variable_definition_id str yes GUID of the environment variable definition. Required when target is 'definition' or 'both'. When target is 'value', this is used to locate the value record. (min_len=36, max_len=36)
target str yes What to delete: 'definition' removes the definition record (and cascades to the value record), 'value' removes only the current value record (leaving the definition intact), 'both' removes the value record first then the definition.

dataverse_delete_environment_variable_value

Delete · idempotent · category variables

Delete an environment variable value record (reset to default).

Note: The definition itself is not affected.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
value_id str | None no None GUID of the environmentvariablevalue record to delete directly. Mutually exclusive with definition_id and name. (min_len=36, max_len=36)
definition_id str | None no None GUID of the environment variable definition. The tool looks up its value record and deletes it. Mutually exclusive with value_id and name. (min_len=36, max_len=36)
name str | None no None Schema name or display name of the environment variable definition. Schema name is tried first (exact match); display name is the fallback. Mutually exclusive with value_id and definition_id. (min_len=1)

dataverse_get_environment_variable_values

Read · idempotent · category variables

Get environment variable value record(s).

Note: When no value record exists for a definition the list will be empty.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
value_id str | None no None GUID of the environmentvariablevalue record to fetch directly. Mutually exclusive with definition_id and name. (min_len=36, max_len=36)
definition_id str | None no None GUID of the environment variable definition whose value record(s) to retrieve. Mutually exclusive with value_id and name. (min_len=36, max_len=36)
name str | None no None Schema name or display name of the environment variable definition. Schema name is tried first (exact match); display name is the fallback. Mutually exclusive with value_id and definition_id. (min_len=1)
top int no 50 Maximum number of value records to return. (ge=1, le=5000)

dataverse_get_environment_variables

Read · idempotent · category variables

List environment variable definitions with their current values.

Note: The value field is null when no value record exists — fall back to defaultvalue in that case.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
name str | None no None Schema name or display name of a single environment variable to look up. Schema name is tried first (exact match); display name is the fallback. When provided, returns that single definition merged with its current value. Cannot be combined with solution_id or solution_unique_name. (min_len=1)
solution_id str | None no None GUID of the solution to scope results to. Only definitions included in this solution are returned. Provide either solution_id or solution_unique_name, not both. Cannot be combined with name. (min_len=36, max_len=36)
solution_unique_name str | None no None Unique name of the solution to scope results to (e.g., 'MyApp'). Only definitions included in this solution are returned. Provide either solution_unique_name or solution_id, not both. Cannot be combined with name. (min_len=1, pattern=^[a-zA-Z_][a-zA-Z0-9_]*$)
top int no 50 Maximum number of records to return. (ge=1, le=5000)

dataverse_update_environment_variable

Write · idempotent · category variables

Update an environment variable definition and/or its current value.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
environment_variable_definition_id str yes GUID of the environment variable definition to update. (min_len=36, max_len=36)
display_name str | None no None New display name for the environment variable. (min_len=1)
default_value str | None no None New default value to set on the definition.
description str | None no None New description for the environment variable.
value str | None no None New current value. If an environmentvariablevalue record already exists it is PATCHed; otherwise a new one is POSTed bound to this definition.

dataverse_update_environment_variable_value

Write · idempotent · category variables

Update an existing environment variable value record.

Note: If no value record exists for the resolved definition, returns an error — use dataverse_create_environment_variable_value to create one first.

Param Type Req Default Notes
dataverse_url str yes Required Dataverse organization URL for this request (e.g., 'https://yourorg.crm.dynamics.com').
value_id str | None no None GUID of the environmentvariablevalue record to PATCH directly. Mutually exclusive with definition_id and name. (min_len=36, max_len=36)
definition_id str | None no None GUID of the environment variable definition. The tool looks up its value record and PATCHes it. Mutually exclusive with value_id and name. (min_len=36, max_len=36)
name str | None no None Schema name or display name of the environment variable definition. Schema name is tried first (exact match); display name is the fallback. Mutually exclusive with value_id and definition_id. (min_len=1)
value str yes The new value string to store in the value record. (min_len=1)

Clone this wiki locally