get_latest_price
Retrieve the current price of a commodity from GnuCash using its symbol and namespace, with optional currency for non-default quotes.
Instructions
Get the most recent price for a commodity.
Args: commodity: Symbol of the commodity (e.g., "VTSAX"). namespace: Namespace of the commodity (e.g., "FUND"). currency: Currency for the price. Defaults to the book's default currency. Pass explicitly to get a price quoted in a non-default currency.
Returns: JSON with date, value, type, and source of most recent price. Returns null if no price exists.
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": {
"commodity": "<commodity>",
"namespace": "<namespace>"
},
"name": "get_latest_price"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| currency | No | ||
| commodity | Yes | ||
| namespace | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |