Price lookup

From infracost/agent-skills · View interactive version

Price lookup is an AI agent skill from the GitHub repository infracost/agent-skills. Look up cloud resource pricing by generating sample Terraform and pricing it with Infracost. Use this skill when the user asks "how much does X cost?" or wants to compare pricing between resource configurations, instance types, regions, or cloud providers. This does not require the user to have any

How to use this skill

Skill file

Price Lookup

Look up cloud resource pricing without needing existing infrastructure code. Supports any resource type that Terraform and Infracost support across AWS, GCP, and Azure.

You synthesize a small Terraform snippet for what the user is asking about and price it. The result is a per-resource breakdown plus a headline summary.

Invoking capabilities

This skill uses the price capability (and optionally the inspect capabilities to reproject

the result). Each has two bindings — a typed MCP tool call and an infracost … CLI command —

listed in BINDINGS.md.

**Rule: if the Infracost MCP server is available, use its tools; otherwise run the equivalent CLI

command from BINDINGS.md.** With MCP, the snippet is passed as a string to the price tool. With

the CLI, the snippet is fed to infracost price on stdin via a heredoc (this is the one command in

the skill set that needs a shell metacharacter — see BINDINGS.md).

Before pricing, satisfy the three preflight capabilities (see BINDINGS.md): the CLI is present,

the user is authenticated, and an organization is selected. With MCP these are resolved on the first

tool call (failures come back as readable errors, not a dropped connection); with the CLI, check

them inline. Never run infracost auth login — it is interactive.

Workflow

1. Write minimal Terraform

Synthesize a small Terraform snippet for the resource(s) the user is asking about. Rules:

2. Price the snippet

Use the price capability with the Terraform snippet (see BINDINGS.md for the exact MCP tool /

CLI invocation):

provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "web_server" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "m5.xlarge"

  root_block_device {
    volume_size = 100
    volume_type = "gp3"
  }
}

For non-USD currencies pass a currency (ISO 4217 code — EUR, GBP, JPY, CAD, AUD, …). If

the user doesn't specify a currency, the org-configured default is used (typically USD).

3. Read the result

A price returns:

Unlike a scan, a price always includes the per-resource list — you've just shipped the IaC, so the cost of returning it is fixed and small.

4. Optional: drill in with the inspect capabilities

The price result is cached just like a scan result. If you want to project the data differently

(e.g. group by type, top N by cost), use any of the inspect capabilities — they all read the latest

cached result by default:

These rarely add value over reading resources[] directly when the snippet is small, but they're handy for "what would the top 5 savings be on this?" follow-ups.

Presenting Results

Lead with the monthly cost — that's what the user came for.

Example presentation

AWS RDS MySQL — db.r5.xlarge, 100GB gp3

Region: us-east-1

| Component | Monthly Cost |

| -------------------- | ------------ |

| Instance (on-demand) | $365.00 |

| Storage (100GB gp3) | $11.50 |

| Total | $376.50 |

Usage-based costs (estimated):

- I/O requests: ~$X/mo based on typical usage

Savings opportunity: Consider Graviton (db.r6g.xlarge) for ~20% savings (~$876/yr).

Important Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.