Skip to main content

Build

Pulumi Context API

PulumiOfficialCertified

Query the Pulumi Context API, a graph query interface over an organization's infrastructure in Pulumi Cloud. Use when a question is about relationships or reachability across resources and stacks: the impact of a change ("what breaks if I change this?", blast radius), what depends on a resource or a stack's outputs, which provider instances manage which resources and at what versions, orphaned or unreferenced resources, or references that cross stacks and cloud accounts, including resources Pulumi doesn't manage. Don't load it for finding a single resource by name, type, or property (Resource Search covers that), or for update history and failure debugging (use skill `pulumi-debug-failed-operation`).

  • New
  • v1.0.3
  • Reviewed Aug 29
  • No reviews yet

Capabilities

  • fetch the primer, always

    Needs Pulumi CLI v3.243.0 or newer and an active pulumi login

  • If this call fails

    Entitlement gates are per-organization, so they cannot appear on this…

  • query

    The body is a JSON selector, not query text

  • Scope of the graph

    Resources, stacks, and the relationships between them, trimmed to the…

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.3

Query the Pulumi Context API

The Context API answers questions about an organization's cloud infrastructure
as a graph: what exists, what depends on what, what a change would affect. It
covers resources found through Pulumi Discovery, not just Pulumi-managed ones.

Prefer it over Resource Search whenever the question involves relationships.
Resource Search finds individual resources but cannot follow edges, so
answering "what depends on X" with repeated searches is slow and usually
incomplete.

Public preview, for organizations on the Enterprise and Business Critical
editions, and a role granting resources:search (the default Member and Admin
roles do).

First: is a graph tool already in the session?

If one is — graph_query and get_graph_schema, under whatever prefix the
server registers them — call it and skip Steps 1 and 2. Compose the selector
from the graph_query tool's own description, which carries the grammar; the
tool resolves the organization and credentials itself and drains pagination for
you. When that description is not enough, get_graph_schema returns the live
field vocabulary and limits, and will serve the full Step 1 primer when asked
for it. Step 3 still governs what you do with the result.

Steps 1 and 2 are the path for an agent that has a shell and no such tool.

Step 1: fetch the primer, always

Needs Pulumi CLI v3.243.0 or newer and an active pulumi login.

bash
pulumi api GetGraphQuerySchema --output=markdown

This returns a self-contained guide to composing selectors — vocabulary, edge
types, engine caps, worked examples, pagination, completeness rules, the gates
that deny a query, and the traps that produce a confident wrong answer instead
of an error. It is served by the deployment that answers your queries, so it is
the contract, and it moves between schema versions. This skill bootstraps you
to it and stops there; everything below defers to it. Fetch it fresh in every
session — a primer remembered from earlier may describe a schema this
deployment no longer serves.

The operation takes no organization; one schema covers every org the login can
reach. --output=json on it returns the same contract as a machine-readable
payload, useful for reading limits or fieldValues programmatically, but
compose from the markdown.

Read it in full — never truncate it with head, tail, or a byte cap. A
clipped primer means malformed selectors and rejected queries.

If this call fails

You have no primer yet, so handle it here rather than looking it up there:

Response Meaning
401 Unauthorized no active pulumi login, or an expired token
404 Not Found, detail-free a wrong path, or a deployment without the endpoint
503 Service Unavailable transient — retry

Entitlement gates are per-organization, so they cannot appear on this call —
they surface in Step 2, by which point the primer's "When it denies you" table
is in hand. If pulumi api doesn't know GetGraphQuerySchema at all, that is
not a gate: run pulumi api list --refresh-spec to refresh the cached spec,
then retry the fetch.

Step 2: query

bash
pulumi api GraphQuery -F orgName=<org> --input selector.json

The body is a JSON selector, not query text. Compose it from the primer you
just read, not from memory or from a grammar you recall from another session.

Name the org explicitly. Left off, -F orgName resolves from the selected
stack or the default org, which is often an individual account with no
entitlement; pulumi whoami -v lists every organization the login can reach.
A denial here names its gate — the primer's "When it denies you" table says
which are worth retrying and which to report to the user.

Step 3: apply the primer's completeness rules before answering

Every response carries fidelity signals — currently meta.resultMode,
meta.visibility, and pageInfo.continuationToken; the primer names the
authoritative set. Read the primer's rules for them and follow them; the
remedies differ per signal and a stale paraphrase here would be worse than
none.

What matters most: a completeness claim needs all of them clean. Impact
analysis, "nothing depends on this", an exhaustive cleanup list, a total across
groups — none of these survive a truncated result, a trimmed traversal, or an
undrained page. When you can't get there, say what the answer does cover.

Scope of the graph

Resources, stacks, and the relationships between them, trimmed to the stacks
and accounts the caller can see. The primer's "What it cannot answer yet"
section is the live boundary — check it before concluding a question is
unanswerable, and reach for a different API rather than approximating one of
those gaps with a graph query.

One boundary worth knowing up front, because it decides which API to use: the
graph returns a schema-declared subset of fields per node type, not full
resource property bags. The primer lists which fields each node type can match
on and which it can return; when the question needs the property values
themselves, they come back from Resource Search.

Human-readable reference:
Context API overview and
query guide.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from Pulumi

View source →
cloudformation-to-pulumiConvert, migrate, or import AWS CloudFormation stacks or templates into Pulumi programs. Load this skill whenever a user wants to move from CloudFormation to Pulumi, convert a CFN template, import existing CloudFormation-managed resources…0 installspackage-usageTrack which stacks across a Pulumi organization use a specific package and at what versions. Use for cross-stack audits, identifying outdated or unmaintained package versions across many stacks, finding affected stacks before publishing…0 installspulumi-deliveryAuthor, register, run, operate, debug and migrate to Pulumi Delivery pipelines (delivery as code), which are Pulumi programs that use the `delivery` package to declare sources, stages, stacks, jobs and approval or manual gates. Use when…0 installsupstream-patchesCreate, amend, remove, and rebase patches for Terraform provider submodules using `./scripts/upstream.sh`. Use when `upgrade-provider` or manual patch work needs owning-patch lookup, patch conflict fixes, patch/hunk removal, or upstream…0 installsprovider-upgradeUpgrade any Pulumi provider to a newer version and reconcile the resulting diff. Use when users want to upgrade or update a provider (including editing package.json, requirements.txt, pyproject.toml, go.mod, or Pulumi.yaml to bump a…0 installspulumi-setup-agent-automationCreate a schedule or event trigger for an existing Pulumi Agent, or pause or resume an automation. Use when the user requests recurring or event-driven agent work, says yes to a proposed schedule or trigger, or asks to pause or resume an…0 installs

Frequently asked questions about pulumi-context-api

What does the pulumi-context-api skill do?

Query the Pulumi Context API, a graph query interface over an organization's infrastructure in Pulumi Cloud. Use when a question is about relationships or reachability across resources and stacks: the impact of a change ("what breaks if I change this?", blast radius), what depends on a resource or a stack's outputs, which provider instances manage which resources and at what versions, orphaned or unreferenced resources, or references that cross stacks and cloud accounts, including resources Pulumi doesn't manage. Don't load it for finding a single resource by name, type, or property (Resource Search covers that), or for update history and failure debugging (use skill `pulumi-debug-failed-operation`). It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the pulumi-context-api skill?

Run `npx @skills-hub-ai/cli install pulumi-context-api` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/pulumi-context-api/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does pulumi-context-api work with?

pulumi-context-api runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the pulumi-context-api skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use pulumi-context-api after installing it?

In Claude Code, type `/pulumi-context-api` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the pulumi-context-api skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/pulumi-context-api)](https://skills-hub.ai/skills/pulumi-context-api)
HTML
<a href="https://skills-hub.ai/skills/pulumi-context-api"><img src="https://skills-hub.ai/api/badges/skill/pulumi-context-api" alt="Install on Skills Hub"></a>

More options in the badge docs.