This document describes how GitHub Copilot was used to build AgriValue Tracker for Battle #1: Creative Apps in the AI Agents League.
Copilot Chat was used to scaffold the Express API structure:
Create an Express API with routes for crop market data, quality evaluation,
and value-chain optimization. Use Azure Key Vault for secrets with env fallback.
Copilot generated the polling loop for Azure AI Foundry agent runs (pollRun), the thread/message/run API sequence, and telemetry logging patterns.
Copilot inline suggestions helped structure the crop → processor → certification ontology:
- Entities: crops, processors, compliance rules, organic bonuses
- Relationships: each processor
inputsa crop; each crop hascertifications - Reasoning:
optimizeValueChain()computes Path A vs Path B with quality multipliers
Prompt used in Copilot Chat:
Model a semantic market graph for Sicilian agriculture: 5 crops, local processors,
transport costs, DOP/DOC certifications, and Foundry compliance rules as separate
functions exportable to both Express and MCP.
Copilot helped implement the Model Context Protocol server exposing three tools:
| Tool | Purpose |
|---|---|
get_market_intelligence |
Grounded pricing and compliance for a crop |
generate_supply_contract |
Draft Fair-Trade supply agreements |
evaluate_crop_quality |
Quality grade and profit multiplier |
Example Copilot Chat prompt (with MCP enabled):
@agrivalue-iq generate_supply_contract crop="Olive Oil" qtyTons=15 isOrganic=true buyer="Cooperativa Valle del Belice"
Now customize section 4 for EU DOP export requirements and add a force majeure clause.
Copilot assisted with:
- Tailwind layout for the "institutional terminal" aesthetic
- Chart.js market trend visualization wired to Fabric IQ forecast data
- Visual quality scanner animation and console log feed
- Contract export and "Copy for Copilot MCP" workflow buttons
When the market chart threw getElementById('trendChart') errors, Copilot Chat identified the missing <canvas> element and suggested wrapping initChart in try/catch for static demo mode.
- Install GitHub Copilot and enable MCP in settings
- Open this repo in VS Code —
.vscode/mcp.jsonregisters the server automatically - Run
npm installthen verify:npm run mcp(should log "running on stdio") - In Copilot Chat, reference tools with
@agrivalue-iq
- Run the app locally (
npm start) - Optimize Olive Oil with organic certification
- Click Copy for Copilot MCP in the results panel
- Paste into Copilot Chat — MCP generates a grounded contract draft
@agrivalue-iq get_market_intelligence crop="Grapes"
Add a new processor "Etna Volcanic Wines" in lib/fabric-iq.js with costs
and update the MCP enum in mcp-server.js
| Component | Copilot role |
|---|---|
| Azure Foundry agent integration | Scaffolding + API version headers |
| Fabric IQ ontology | Data structure + helper functions |
| MCP tool schemas | JSON Schema definitions |
| UI copy and styling | Tailwind classes + animation CSS |
| Security (Key Vault, .env) | Pattern suggestions, manual review |
| Challenge documentation | Structure outline, manual editing |
Copilot was not given real API keys. All secrets use .env (gitignored) per the challenge security guidelines. See .env.example for required variables.