az agent tool resource

Search and inspect Azure resources from the local ARM cache.

Commands

Name Description Type Status
az agent tool resource find

Search the local ARM resource cache by name pattern, returning matching resources as JSON.

Core Preview
az agent tool resource refresh

Synchronously refresh the on-disk ARM cache used by agent tool resource find/tree/show.

Core Preview
az agent tool resource show

Return details for one resource from the local ARM cache, optionally augmented with a live ARM GET for deep fields (properties, provisioningState).

Core Preview
az agent tool resource sku

Given a VM SKU, report which Azure regions currently expose that SKU for the current subscription.

Core Preview
az agent tool resource tree

Return the resource hierarchy under a node (tenant, subscription, resource group, or resource) from the local ARM cache.

Core Preview

az agent tool resource find

Preview

Search the local ARM resource cache by name pattern, returning matching resources as JSON.

az agent tool resource find wraps the agent's find_resources tool: exact match preferred, falls back to substring, then Levenshtein typo correction. Results include the resource id, name, type, resource group, and location. External AI tools use this to resolve a user-supplied name to a concrete resource id before performing further operations. Backed by the on-disk ARM cache under ~/.azclips/agent/arm/, so it is orders of magnitude faster than an ARM roundtrip.

az agent tool resource find --name
                            [--kind]
                            [--resource-group]
                            [--subscription-id]
                            [--top]

Examples

Find any resource whose name matches "prod"

az agent tool resource find --name prod

Restrict the search to resource groups only

az agent tool resource find --name prod --kind resourceGroup

Disambiguate a name that repeats across subscriptions

az agent tool resource find --name prod --subscription-id 00000000-0000-0000-0000-000000000000

Narrow to a resource group and cap the result count

az agent tool resource find --name prod --kind resource --resource-group my-rg --top 25

Required Parameters

--name

Name pattern to match against cached Azure resource names.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--kind

Optional kind filter (tenant | subscription | resourceGroup | resource). Defaults to all kinds.

--resource-group

Optional resource group name to narrow the search (only meaningful for kind=resource).

--subscription-id

Optional subscription id or display name to narrow the search.

--top

Max candidates to return. Default 10.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az agent tool resource refresh

Preview

Synchronously refresh the on-disk ARM cache used by agent tool resource find/tree/show.

az agent tool resource refresh rebuilds the on-disk cache under ~/.azclips/agent/arm/<tenantId>/ and waits for it to finish before returning. The other resource commands (find, tree, show) kick a background refresh and answer from whatever is on disk — on a cold machine that's empty. Use this command once at setup, then again whenever the cache looks stale (e.g. you just created resources and they are missing from find results).

az agent tool resource refresh

Examples

First-time setup

az agent tool resource refresh

After creating new resources you want to query immediately

az group create --name my-new-rg --location eastus --subscription-id 00000000-0000-0000-0000-000000000000
az agent tool resource refresh
az agent tool resource find --name my-new-rg --kind resourceGroup
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az agent tool resource show

Preview

Return details for one resource from the local ARM cache, optionally augmented with a live ARM GET for deep fields (properties, provisioningState).

az agent tool resource show wraps the agent's get_resource_details tool. Given a resource name or full ARM id, returns the cache row (id, type, location, sku, tags, kind, identity, managedBy). Pass --live to also fetch the current ARM body — costs one live GET (~200-500ms) but exposes fields the cache does not carry (properties, provisioningState, endpoints, encryption). Default is cache-only.

az agent tool resource show --name
                            [--kind]
                            [--live]
                            [--resource-group]
                            [--subscription-id]

Examples

Show one VM from the cache

az agent tool resource show --name my-vm --kind resource

Get live ARM state (needed for provisioningState / properties)

az agent tool resource show --name my-vm --kind resource --live

Look up by ARM id

az agent tool resource show --name /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-rg/providers/Microsoft.Compute/virtualMachines/my-vm

Disambiguate a name shared across subscriptions or resource groups

az agent tool resource show --name my-vm --kind resource --subscription-id 00000000-0000-0000-0000-000000000000 --resource-group my-rg

Required Parameters

--name

Name or full ARM id.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--kind

Optional kind filter: tenant | subscription | resourceGroup | resource.

--live

Fetch live ARM body (properties, provisioningState, endpoints). Adds ~200-500ms. Default false.

--resource-group

Optional resource group to scope the lookup (only meaningful for kind=resource).

--subscription-id

Optional subscription id or display name to scope the lookup.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az agent tool resource sku

Preview

Given a VM SKU, report which Azure regions currently expose that SKU for the current subscription.

az agent tool resource sku wraps the agent's find_available_locations tool. Given a VM SKU (for example Standard_D2s_v5), it probes a common set of Azure regions in parallel via providers/Microsoft.Compute/skus and returns a JSON list showing which locations have the SKU available, which are blocked at the location level, and which zones inside each location expose it. Backs the agent's automatic recovery from SkuNotAvailable errors on vm create.

az agent tool resource sku --vm-size
                           [--subscription-id]

Examples

Check where Standard_D2s_v5 is available

az agent tool resource sku --vm-size Standard_D2s_v5

Check availability for a specific subscription

az agent tool resource sku --vm-size Standard_D2s_v5 --subscription-id 00000000-0000-0000-0000-000000000000

Required Parameters

--vm-size

VM SKU to check, e.g. 'Standard_D2s_v5'.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--subscription-id

Optional subscription id. Defaults to the current auth-context subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az agent tool resource tree

Preview

Return the resource hierarchy under a node (tenant, subscription, resource group, or resource) from the local ARM cache.

az agent tool resource tree wraps the agent's get_resource_tree tool. Given a node identifier and its kind (tenant, subscription, resourceGroup, or resource), returns the subtree beneath it as JSON — subscriptions under a tenant, resource groups under a subscription, resources under a group. --max-depth (default 2) caps the traversal so the JSON does not balloon on large scopes. Backed by the on-disk ARM cache under ~/.azclips/agent/arm/.

az agent tool resource tree --kind
                            --name
                            [--max-depth]
                            [--subscription-id]

Examples

List every resource group in a subscription

az agent tool resource tree --name my-subscription --kind subscription

Drill deeper (subscription → RG → resource)

az agent tool resource tree --name my-subscription --kind subscription --max-depth 3

Show what a resource group contains

az agent tool resource tree --name my-rg --kind resourceGroup

Disambiguate a resource group whose name repeats across subscriptions

az agent tool resource tree --name my-rg --kind resourceGroup --subscription-id 00000000-0000-0000-0000-000000000000

Required Parameters

--kind

Kind of node to root the tree at: tenant | subscription | resourceGroup | resource.

--name

Name, full ARM id, subscription id/name, or tenant id.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--max-depth

Max depth from the root node. Defaults to 2.

--subscription-id

Optional subscription scope when kind=resourceGroup and the RG name repeats across subscriptions.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.