Get context

Transaction · Acts onchain

Returns the options every input of an action accepts for this address: the tokens it holds, the pools that exist, the chains it can act on, resolved against the live catalog. This is the surface the composer runs on. Send the action sequence being drafted and the response carries a valid option set for each unfilled input, plus request-scoped context such as a swap quote or a live maximum projected over what has been filled so far. The options are already filtered to what would actually compile. Reach for it while building a transaction, once per edit, so the person or agent doing the composing only ever sees choices that work.

Send a request

Response

{
links: {
self: string
prev: string | undefined
next: string | undefined
} | undefined
headers: unknown | undefined
data: Record<string, {
name: string
symbol: string
icon: string
description: string | undefined
tags: string[]
chains: ({
chain_id: number
address: string
name: string
symbol: string
decimals: number
icon: string
external: Record<string, {
name: string
url: string
}>
block_time: number
})[]
links: ({
kind: string
url: string
})[] | undefined
actions: Record<string, {
type: string
sentence: {
raw: string
template: string
inputs: ({
name: string | undefined
type: literal | object | undefined
defaultValue: string | undefined
requires: number[] | undefined
delimiter: string | undefined
hidden: boolean | undefined
coil: boolean | undefined
tags: ({
kind: string
value: string | undefined
qualifiers: (self | undefined)[] | undefined
dynamic: boolean | undefined
reference: number | undefined
})[] | undefined
selectorTags: Record<string, ({
kind: self | undefined
value: self | undefined
qualifiers: self | undefined
dynamic: self | undefined
reference: self | undefined
})[]> | undefined
})[]
outputs: ({
name: string
type: string | array
offset: number
dynamic: boolean | undefined
tags: ({
kind: string
value: string | undefined
qualifiers: (self | undefined)[] | undefined
dynamic: boolean | undefined
reference: number | undefined
})[] | undefined
selectorTags: Record<string, ({
kind: self | undefined
value: self | undefined
qualifiers: self | undefined
dynamic: self | undefined
reference: self | undefined
})[]> | undefined
selectorInput: number | undefined
})[] | undefined
}
name: string
description: string
icon: string
attributes: {
is:user_specific: boolean | undefined
is:unlisted: boolean | undefined
} | undefined
feeds: string[] | undefined
options: Record<string, array | Record<string, array | self>> | undefined
meta: {
action: Record<string, unknown> | undefined
inputs: Record<string, Record<string, unknown>> | undefined
} | undefined
}> | undefined
}> | null
}

Code samples

Language

Claude

Prompt

Call the Plug API endpoint "Get context".
## Endpoint
POST /address/{address}/
Base URL: https://api.plug.to
## Description
Returns the options every input of an action accepts for this address: the tokens it holds, the pools that exist, the chains it can act on, resolved against the live catalog.
This is the surface the composer runs on. Send the action sequence being drafted and the response carries a valid option set for each unfilled input, plus request-scoped context such as a swap quote or a live maximum projected over what has been filled so far. The options are already filtered to what would actually compile.
Reach for it while building a transaction, once per edit, so the person or agent doing the composing only ever sees choices that work.
## Path Parameters
- address (string, required) — The EVM address to get information for. In the case that you request an address we have never indexed, we will immediately index it.
Current value: 0x62180042606624f02d8a130da8a3171e9b33894d
## Query Parameters
- filter[chain_id] (integer, optional) — Filter results to specific chains from the listed of supported options.
- filter[protocol] (string, optional) — Filter results to specific protocols from the listed of supported options.
- filter[action] (string, optional) — Filter results to specific actions from the listed of supported options.
- filter[unlisted] (boolean, optional) — Include unlisted contracts in the results. [true, false]
- search (string, optional) — Search within the returned options by input index of an action sentence. This is helpful when letting users refine the options shown for a specific action input such as tokens, vaults or liquidity pools.
- intent (string, optional) — Whether an action's options are scoped to the caller's holdings (imperative, acting now) or the full universe of valid targets (declarative, composing a flow). Defaults to declarative. [imperative, declarative]
- input (integer, optional) — The focused input index whose option list is being paginated. Paired with limit; the response windows only this input's list.
- selections (string, optional) — Values already chosen for the focused input's dependency inputs, keyed by input index, so a dependent list (e.g. a market that hangs off a chosen token) windows against its parent.
- draft (string, optional) — The full partial assignment, every input the user has filled so far keyed by input index, so the server can project request-scoped meta (a swap quote, a live max) over the complete in-flight request.
- limit[count] (integer, required)
- limit[offset] (integer, optional)
## Headers
- Accept (string, required) — For a typical single-time JSON response, set this to application/json. To receive realtime updates through a stream, set this to text/event-stream. (default: application/json) [application/json, text/event-stream]
Current value: application/json
## Response Schema
- links (object, optional)
- self (string, required)
- prev (string, optional)
- next (string, optional)
- headers (unknown, optional)
- data (Record<string, object>, optional)
## Example Request
POST https://api.plug.to/address/0x62180042606624f02d8a130da8a3171e9b33894d/