|
| 1 | +--- |
| 2 | +applyTo: "**/*-record.yml,**/BREEDING-EVENT-LOG*,reports/**" |
| 3 | +--- |
| 4 | + |
| 5 | +# NSIP MCP Agent Instructions |
| 6 | + |
| 7 | +When working with breeding record issues, event logs, or livestock data queries, use |
| 8 | +the NSIP MCP tools described below. This document is the authoritative reference for |
| 9 | +agent-driven interactions with the NSIP Search API. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## What is the NSIP MCP Server? |
| 14 | + |
| 15 | +The NSIP MCP server wraps the [National Sheep Improvement Program](https://nsip.org/) |
| 16 | +Search API as a Model Context Protocol service. It gives AI agents direct access to: |
| 17 | + |
| 18 | +- **400,000+ sheep** with estimated breeding values (EBVs) |
| 19 | +- **Pedigree trees** spanning multiple generations |
| 20 | +- **Breed-level benchmarks** (trait ranges, averages) |
| 21 | +- **Breeding analytics** — inbreeding coefficients, trait ranking, mating recommendations |
| 22 | + |
| 23 | +**Transport**: stdio only — started with `nsip mcp` |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Tool Reference |
| 28 | + |
| 29 | +### search |
| 30 | + |
| 31 | +Find animals matching filter criteria. Returns paginated results. |
| 32 | + |
| 33 | +| Parameter | Type | Required | Default | Description | |
| 34 | +|---|---|---|---|---| |
| 35 | +| `breed_group_id` | integer | no | | Breed group ID | |
| 36 | +| `breed_id` | integer | no | | Breed ID | |
| 37 | +| `status` | string | no | | `"CURRENT"`, `"SOLD"`, or `"DEAD"` | |
| 38 | +| `gender` | string | no | | `"Male"`, `"Female"`, or `"Both"` | |
| 39 | +| `born_after` | string | no | | Animals born after this date (`YYYY-MM-DD`) | |
| 40 | +| `born_before` | string | no | | Animals born before this date (`YYYY-MM-DD`) | |
| 41 | +| `proven_only` | boolean | no | false | Only return proven animals | |
| 42 | +| `flock_id` | string | no | | Flock ID | |
| 43 | +| `sort_by` | string | no | | Trait abbreviation to sort by (e.g. `"WWT"`) | |
| 44 | +| `reverse` | boolean | no | false | Reverse the sort order | |
| 45 | +| `page` | integer | no | 0 | Page number (0-indexed) | |
| 46 | +| `page_size` | integer | no | 15 | Results per page (1-100) | |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +### details |
| 51 | + |
| 52 | +Fetch full EBV data, breed, contact info, and status for one animal. |
| 53 | + |
| 54 | +| Parameter | Type | Required | Description | |
| 55 | +|---|---|---|---| |
| 56 | +| `animal_id` | string | yes | LPN ID or registration number | |
| 57 | + |
| 58 | +--- |
| 59 | + |
| 60 | +### lineage |
| 61 | + |
| 62 | +Retrieve the pedigree (ancestry) tree — parents, grandparents, and deeper ancestors. |
| 63 | + |
| 64 | +| Parameter | Type | Required | Description | |
| 65 | +|---|---|---|---| |
| 66 | +| `animal_id` | string | yes | LPN ID | |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +### progeny |
| 71 | + |
| 72 | +List offspring for an animal with pagination. |
| 73 | + |
| 74 | +| Parameter | Type | Required | Default | Description | |
| 75 | +|---|---|---|---|---| |
| 76 | +| `animal_id` | string | yes | | LPN ID | |
| 77 | +| `page` | integer | no | 0 | Page number (0-indexed) | |
| 78 | +| `page_size` | integer | no | 10 | Results per page | |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +### profile |
| 83 | + |
| 84 | +All-in-one call that combines `details`, `lineage`, and `progeny` in a single request. |
| 85 | + |
| 86 | +| Parameter | Type | Required | Description | |
| 87 | +|---|---|---|---| |
| 88 | +| `animal_id` | string | yes | LPN ID | |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +### breed_groups |
| 93 | + |
| 94 | +List all breed groups and individual breeds in the NSIP database. No parameters. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### trait_ranges |
| 99 | + |
| 100 | +Get the min/max EBV values across all animals within a breed. |
| 101 | + |
| 102 | +| Parameter | Type | Required | Description | |
| 103 | +|---|---|---|---| |
| 104 | +| `breed_id` | integer | yes | Breed ID | |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### compare |
| 109 | + |
| 110 | +Side-by-side EBV comparison of 2-5 animals. Optionally filter to specific traits. |
| 111 | + |
| 112 | +| Parameter | Type | Required | Description | |
| 113 | +|---|---|---|---| |
| 114 | +| `animal_ids` | array of strings | yes | LPN IDs (2-5 items) | |
| 115 | +| `traits` | string | no | Comma-separated trait filter (e.g. `"BWT,WWT,YWT"`) | |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +### rank |
| 120 | + |
| 121 | +Rank animals within a breed by a weighted composite score. |
| 122 | + |
| 123 | +| Parameter | Type | Required | Default | Description | |
| 124 | +|---|---|---|---|---| |
| 125 | +| `breed_id` | integer | yes | | Breed ID to search | |
| 126 | +| `weights` | object | yes | | Trait-to-weight map, e.g. `{"BWT": -1.0, "WWT": 2.0}` | |
| 127 | +| `gender` | string | no | | `"Male"`, `"Female"`, or `"Both"` | |
| 128 | +| `status` | string | no | | `"CURRENT"`, `"SOLD"`, `"DEAD"` | |
| 129 | +| `top_n` | integer | no | 10 | Number of top results to return | |
| 130 | + |
| 131 | +--- |
| 132 | + |
| 133 | +### inbreeding_check |
| 134 | + |
| 135 | +Calculate Wright's coefficient of inbreeding (COI) for a potential sire x dam mating. |
| 136 | + |
| 137 | +| Parameter | Type | Required | Description | |
| 138 | +|---|---|---|---| |
| 139 | +| `sire_id` | string | yes | LPN ID of the sire (father) | |
| 140 | +| `dam_id` | string | yes | LPN ID of the dam (mother) | |
| 141 | + |
| 142 | +**COI traffic-light thresholds:** |
| 143 | + |
| 144 | +| Rating | COI | Recommendation | |
| 145 | +|---|---|---| |
| 146 | +| Green | < 6.25% | Safe — proceed | |
| 147 | +| Yellow | 6.25-12.5% | Caution — consider alternatives | |
| 148 | +| Red | > 12.5% | Avoid — high inbreeding depression risk | |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +### mating_recommendations |
| 153 | + |
| 154 | +Find optimal mates for an animal. |
| 155 | + |
| 156 | +| Parameter | Type | Required | Default | Description | |
| 157 | +|---|---|---|---|---| |
| 158 | +| `animal_id` | string | yes | | LPN ID of the animal to find mates for | |
| 159 | +| `breed_id` | integer | yes | | Breed ID to search for candidates | |
| 160 | +| `target_traits` | string | no | WWT, BWT, NLB | Comma-separated traits to optimize | |
| 161 | +| `max_results` | integer | no | 5 | Number of recommendations | |
| 162 | + |
| 163 | +--- |
| 164 | + |
| 165 | +### flock_summary |
| 166 | + |
| 167 | +Summarize a flock: animal count, gender breakdown, and average EBV traits. |
| 168 | + |
| 169 | +| Parameter | Type | Required | Description | |
| 170 | +|---|---|---|---| |
| 171 | +| `flock_id` | string | yes | Flock ID | |
| 172 | +| `breed_id` | integer | no | Filter to a specific breed within the flock | |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +### database_status |
| 177 | + |
| 178 | +Check when the NSIP database was last updated. No parameters. |
| 179 | + |
| 180 | +--- |
| 181 | + |
| 182 | +## EBV Trait Glossary |
| 183 | + |
| 184 | +| Abbreviation | Full Name | Unit | Selection | |
| 185 | +|---|---|---|---| |
| 186 | +| BWT | Birth Weight | lbs | Lower preferred | |
| 187 | +| WWT | Weaning Weight | lbs | Higher preferred | |
| 188 | +| PWWT | Post-Weaning Weight | lbs | Higher preferred | |
| 189 | +| YWT | Yearling Weight | lbs | Higher preferred | |
| 190 | +| FAT | Fat Depth | mm | Moderate preferred | |
| 191 | +| EMD | Eye Muscle Depth | mm | Higher preferred | |
| 192 | +| NLB | Number of Lambs Born | lambs | Higher (with caution) | |
| 193 | +| NWT | Number of Lambs Weaned | lambs | Higher preferred | |
| 194 | +| PWT | Pounds Weaned | lbs | Higher preferred | |
| 195 | +| DAG | Dag Score | score | Lower preferred | |
| 196 | +| WEC | Worm Egg Count | eggs/g | Lower preferred | |
| 197 | +| FEC | Faecal Egg Count | eggs/g | Lower preferred | |
| 198 | + |
| 199 | +## Formatting Rules |
| 200 | + |
| 201 | +1. **Always use tables** for EBV data — never dump raw JSON. |
| 202 | +2. **Show accuracy** alongside every EBV value: `+9.6 (68%)`. |
| 203 | +3. **Use the traffic light** for COI results (Green/Yellow/Red). |
| 204 | +4. **Include breed context** whenever possible via `trait_ranges`. |
| 205 | +5. **Caveat low accuracy**: Note if a key trait has accuracy below 40%. |
| 206 | +6. **Use the trait's natural units**: lbs for weights, mm for depth/fat, lambs for NLB/NWT. |
0 commit comments