How to Use AFCD foods in a category in opencode
Returns the foods in an AFCD category with their provenance notes. Use it to assemble a category inventory, such as ready-to-eat breakfast cereals, before examining nutrient profiles.
Prompts to try with AFCD foods in a category in opencode
Copy an example into opencode, or ask in your own words.
Use AFCD foods in a category to populate the project's ready-to-eat breakfast cereal view with returned food names and provenance notes.
Use AFCD foods in a category to look this up and give me the result as a table. Save the result in ./assets.
Pull the latest numbers from AFCD foods in a category and tell me what changed since last week.
Check AFCD foods in a category and summarize what you find in three bullet points.
Pull the newest data from AFCD foods in a category and give me the result as a table.
How to set up AFCD foods in a category in opencode
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the server
Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
- Sign in
Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.
opencode mcp auth spiral
- Check it
Spiral shows as connected.
opencode mcp list
Use the Spiral skill
- Send opencode this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run AFCD foods in a category
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "alexandria", "model": "afcd-foodstandards-gov-au/foods/list_foods_in_group", "input": { "food_group_id": 1, "sub_food_group_id": 1 } }'
Then paste one of the prompts above: opencode finds AFCD foods in a category on Spiral, shows the price and runs it.
AFCD foods in a category providers and prices
Spiral runs AFCD foods in a category through Alexandria. Open a card for today's price, with every fee included.
$0.00873 per call.
Settings you can ask for
Ask opencode for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Food group ID | a number from 1 | AFCD food group id (1-22). | |
| Sub food group ID | a number from 1 | AFCD sub food group id belonging to that group. | |
| Page | a number from 1 | 1 | 1-based page of the client-side paginated result (the API returns the whole list). |
| Page size | 1 to 200 | 50 | Rows per page (1-200). |
Every API field of Australian Food Composition Database (AFCD, FSANZ) · List foods in group is on its tool page: open its card above.
What can you do with AFCD foods in a category in opencode?
Build an Australian food reference browser with category navigation, nutrient explanations, and food comparisons. A coding agent can use AFCD descriptions and Public Food Keys to connect search results to the correct detail records.
Compare breakfast cereals
Identify the ready-to-eat cereal category, list its foods, and resolve named cereals. Check nutrient definitions, rank the entries by iron, and inspect the selected food profiles and sampling notes.
Build a cheese reformulation reference
Find AFCD's cheese categories and enumerate the reference foods. Match named cheese types, check sodium definitions and units, then compare sodium values and inspect the underlying profiles.
Match recipe ingredients to reference foods
Map ingredients such as rolled oats, milk, and almonds to AFCD descriptions. Browse the relevant categories when names are ambiguous, then inspect preparation details and nutrient profiles before calculating recipe estimates.
Create an Australian food reference browser
Use the category hierarchy and category inventories for navigation, food search for lookup, nutrient definitions for explanations, nutrient comparisons for sorting, and individual profiles for the detail view.
Review changes to a food reference collection
Periodically compare retrieved categories, food inventories, nutrient definitions, rankings, and selected profiles with earlier observations. Produce a review queue when AFCD descriptions or values change.
Review the evidence behind category comparisons
List foods in a category, resolve ambiguous names, and inspect selected derivation and sampling notes. Explain which comparisons rely on analyzed foods and which involve calculated or borrowed data.
More on AFCD foods in a category and opencode
Overview
AFCD foods in a category in other agents
Questions about AFCD foods in a category in opencode
Can opencode use AFCD foods in a category?
Yes. Add Spiral to opencode as an MCP server, and opencode can find and run AFCD foods in a category like any built-in tool.
How much does AFCD foods in a category cost in opencode?
$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.
Do I need an Alexandria account to use AFCD foods in a category in opencode?
No. Spiral runs AFCD foods in a category on its own Alexandria account. You sign in to Spiral once and never paste a key.
How long does it take to set up AFCD foods in a category in opencode?
About two minutes: add the server, then sign in, then check it.
Does opencode wait while AFCD foods in a category runs?
AFCD foods in a category runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.
Which foods does AFCD cover?
AFCD covers 1,588 foods commonly available in Australia. Its coverage is a reference selection of Australian foods, rather than a complete inventory of products sold worldwide.
How many nutrients can AFCD describe?
AFCD reports up to 268 nutrients per food. The nutrient documentation explains the units, derivation, assumptions, and limitations used for those components.
What changed in the latest AFCD dataset?
Release 3 incorporated new analytical data for 118 foods and an updated vitamin D dataset. That update describes the dataset as a whole; individual sampling notes provide the evidence behind a particular food.
Are all AFCD values laboratory measurements?
Laboratory analysis is the primary source, but a food's derivation can also identify calculated, borrowed, or label-based data. Sampling notes can include how many samples were purchased and where and when they were purchased.
Are nutrient comparisons based on serving size?
AFCD's nutrient comparison tables report values per 100 g. A ranking therefore compares equal food weights, which can differ substantially from the amounts someone would serve.
Start using AFCD foods in a category in opencode
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into opencode:
set up https://spiral.ai/SKILL.md


