TokenPad
Prompts

Prompt Template Variable Extractor

List every variable a template needs, with usage counts and a typed skeleton.

Your input

181 characters3 lines0 tokensor drop a file

Variable ExtractorExact
0Token change
Token change0no change
Input tokens0what you pasted
Output tokens0what you would send
Token cost of this result
Output tokens0
As input$0.00
× 100K requests$0.00

Everything on this page runs in your browser. Nothing you paste is transmitted, because there is no server here to transmit it to.

Result
 

Templates outgrow their documentation

A prompt template that has been edited over several months by several people accumulates variables. Nobody maintains a list, and the only authoritative source is the template itself.

Extracting the list mechanically is how you find the variable that was added six weeks ago and is only populated on one code path.

Generating a type

The TypeScript output turns an unfilled placeholder from a runtime surprise into a compile error. That is the single most effective fix for this class of bug, and it costs nothing to adopt.

The JSON skeleton serves the same purpose for a test fixture: it gives you every key the template needs, so a test cannot silently omit one.

What the usage counts tell you

A variable used once is usually fine. A variable used four times is a maintenance risk — change its meaning and you must find every occurrence, and templates are not refactored by tooling.

Repeated substitution is also a token cost: the same value inserted four times is billed four times. Where the repetition exists for emphasis rather than necessity, it is usually removable.

Frequently asked questions

Does it detect variables in more than one syntax at once?
No — pick the syntax your framework uses. Mixing syntaxes in one template is worth avoiding anyway, since it makes the template harder to reason about than the tokens it saves.
Why generate a TypeScript type?
Because an unfilled placeholder fails silently at runtime and produces a strange model response. A type turns it into a compile error, which is the cheapest possible place to catch it.

More prompts tools