tf_get_schema
Retrieves exact arguments and nested blocks for one Terraform type at the pinned provider version, so you can validate writable fields before editing resource, data, or ephemeral blocks.
Instructions
Exact arguments and nested blocks for one type at the PINNED provider version. Use BEFORE writing or editing any resource/data/ephemeral block; only arguments listed here exist. 'computed (read-only)' attributes cannot be set. kind: resource | data | ephemeral. Executes code: unless the schema is cached, this runs terraform providers schema, which starts the provider plugins installed under dir/.terraform/providers (with credential environment variables removed; they still run as your user).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"type_name": "<type_name>"
},
"name": "tf_get_schema"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | Terraform root module directory (must already be initialized), inside the server's directory or TERRAFORM_CWD_MCP_ALLOWED_DIRS. Default: TERRAFORM_CWD_MCP_DIR, else the server's working directory. | |
| kind | No | resource | data | ephemeral | resource |
| max_depth | No | Nested block levels to expand (default 3) | |
| type_name | Yes | Full type name, e.g. aws_s3_bucket | |
| description_chars | No | Truncate each description to this many characters; 0 = no limit (default 160) |