Spiral gives your agent every tool with one account. Browse the tools →

opencode · Industry Data

How to Use Canadian Nutrient File nutrient rankings in opencode

Get foods ranked by one nutrient, with food codes, portions, weights, and nutrient amounts. Use it to compare nutrient sources, checking the reported portions before interpreting the order.

Prompts to try with Canadian Nutrient File nutrient rankings in opencode

Copy an example into opencode, or ask in your own words.

Use Canadian Nutrient File nutrient rankings to compare calcium sources within dairy foods, then add a table to our project that preserves each result's portion and weight.

Canadian Nutrient File nutrient rankingsopencode
Try asking
  • Use Canadian Nutrient File nutrient rankings to look this up and give me the result as a table. Save the result in ./assets.

  • Pull the latest numbers from Canadian Nutrient File nutrient rankings and tell me what changed since last week.

  • Check Canadian Nutrient File nutrient rankings and summarize what you find in three bullet points.

  • Pull the newest data from Canadian Nutrient File nutrient rankings and give me the result as a table.

How to set up Canadian Nutrient File nutrient rankings in opencode

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. 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
  2. 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
  3. Check it

    Spiral shows as connected.

    opencode mcp list

Use the Spiral skill

  1. Send opencode this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. 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

  1. Create an API key

    In the console, under API keys.

  2. Run Canadian Nutrient File nutrient rankings

    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": "food-nutrition-canada-ca/foods/search_foods_by_nutrient",
        "input": {
          "nutrient_id": 1
        }
      }'

Then paste one of the prompts above: opencode finds Canadian Nutrient File nutrient rankings on Spiral, shows the price and runs it.

Canadian Nutrient File nutrient rankings providers and prices

Spiral runs Canadian Nutrient File nutrient rankings through Alexandria. Open a card for today's price, with every fee included.

AlexandriaIndustry Data

Settings you can ask for

Ask opencode for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Nutrient IDa number from 1

CNF nutrient_name_id (e.g. 203 Protein, 339 Vitamin D µg, 301 Calcium).

Sortdesc or ascdesc

Order by nutrient amount.

Limit1 to 50050

limit

Offseta number from 00

offset

Food group IDa number from 00

CNF food group id from list_food_groups; 0 (default) searches all food groups.

Include traceon or off

Also list foods whose amount is a trace (the form's 'Include all values = trace').

Every API field of Canadian Nutrient File, Health Canada (food-nutrition.canada.ca) · Search foods by nutrient is on its tool page: open its card above.

What can you do with Canadian Nutrient File nutrient rankings in opencode?

Build a Canadian food comparison feature with CNF descriptions, categories, nutrient definitions, and portion-aware results. A coding agent can turn this 2015 reference data into labeled tables for recipe and menu projects.

Build a recipe substitution reference

Find descriptions matching lentils, beans, and chickpeas, organize them by CNF food category, resolve protein and fiber definitions, rank candidates, and inspect portions before proposing ingredient substitutions.

Compare cafeteria menu ingredients

Organize candidate ingredients by food category, match their preparation descriptions, identify sodium and protein units, and compare ranked foods with their detailed serving profiles.

Create a food composition classroom exercise

Let students choose a CNF category and nutrient, find familiar foods, examine the ranking, and compare the reported portions with complete food profiles. Include the edition and nutrient units in the worksheet.

Screen ingredients for a product concept

Build a category-based shortlist for a soup or snack concept, resolve the nutrients of interest, rank candidate foods, and review matching descriptions and portion values. Use the results as reference estimates during concept work.

Prepare nutrient source tables

Choose a CNF food category and rank its foods by one nutrient. Show the returned portion and weight beside each amount so readers can assess the comparison.

Draft a public food comparison article

Find the food descriptions used in an article, check nutrient definitions, and inspect ranked results and detailed profiles before writing comparisons.

Questions about Canadian Nutrient File nutrient rankings in opencode

Can opencode use Canadian Nutrient File nutrient rankings?

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Canadian Nutrient File nutrient rankings like any built-in tool.

How much does Canadian Nutrient File nutrient rankings 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 Canadian Nutrient File nutrient rankings in opencode?

No. Spiral runs Canadian Nutrient File nutrient rankings on its own Alexandria account. You sign in to Spiral once and never paste a key.

How long does it take to set up Canadian Nutrient File nutrient rankings in opencode?

About two minutes: add the server, then sign in, then check it.

Does opencode wait while Canadian Nutrient File nutrient rankings runs?

Canadian Nutrient File nutrient rankings runs in the background. opencode starts the run, checks on it and gives you the json when it's ready.

Does the online CNF contain the latest Canadian nutrient dataset?

The online CNF still serves the 2015 edition, and Health Canada says those pages will not be updated. The 2026 dataset is available separately, so an online lookup does not establish a food's current formulation.

How much food and nutrient coverage does the online edition have?

The 2015 CNF contains 5,690 foods with up to 152 food components. Coverage varies by food and nutrient; an unavailable nutrient value is not a measured zero.

Where do the Canadian food values come from?

The 2015 CNF incorporates USDA reference data through SR27 for foods corresponding to the Canadian market. Health Canada adjusts values for Canadian fortification and regulatory standards and adds Canadian food data.

Are nutrient amounts based on a serving or on food weight?

The underlying CNF values are recorded per 100 grams of edible food. Food-specific conversion factors translate those values into household measures, so a volume measure needs the weight associated with that food.

Can CNF values replace a packaged product's nutrition label?

CNF values generally represent averages across products, with brand-specific information only where the description identifies it. Health Canada says the generic information is not specific enough to produce a product's Nutrition Facts table.

Get started

Start using Canadian Nutrient File nutrient rankings in opencode

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into opencode:

Set up opencode

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options