Migrating from 1.x
Guide
The breaking changes in version 2.0.0 (result envelopes, summary records, normalized values, removed and deprecated parameters, stricter input) and how to update callers.
Version 2.0.0 changes what the tools return and tightens what they accept.1 Tool names do not change: search_nsf_awards, search_by_institution, search_by_pi, get_award_details and get_project_outcomes. Code that parses tool results, and prompts that rely on fields that are now omitted by default, need the updates below.2
To upgrade, pull and rebuild (Installation), then restart the client.
Summary of breaking changes
The README’s migration notes list these changes.2
| Change in 2.0.0 | What to do |
|---|---|
Search output is an object envelope, { awards, totalResults, ... }, not a bare array |
Read structuredContent.awards, or parse content[0].text, which is now the whole envelope |
| Search records are summaries by default | Pass detail: "full" or printFields, or call get_award_details |
get_award_details returns { "award": { ... } }, without publications or the outcome report HTML |
Read .award; pass includePublications: true; use get_project_outcomes for the report |
get_project_outcomes returns plain text only |
Pass includeHtml: true to get outcomesReportHtml too |
| Amounts are numbers (they were strings) | Stop converting them |
activeAwd, histAwd and publicAccessMandate are booleans |
Compare with true, not "true" |
pi and coPDPI are arrays of objects in full records |
Read .name, .email and .former |
piMiddeInitial is renamed piMiddleInitial |
Rename the field in your code |
agency is removed from search_nsf_awards |
Drop the argument |
includeExpired is deprecated |
Use status |
Invalid dates and reversed ranges are rejected instead of dropped; awardId must be numeric; offset stops at 9999 |
Fix the arguments |
Search results are an object
Search tools now return an envelope as structuredContent. content[0] holds the same object as JSON text, and content[1] is a paging hint for text-only clients.2 The same hint is also the envelope’s hint field, because some clients pass only the structured content or the first block to the model:3 4
{
"awards": [ { "id": "2535052", "title": "...", "estimatedTotalAmt": 1113000, "activeAwd": true } ],
"totalResults": 981,
"offset": 0,
"limit": 25,
"returned": 25,
"hasMore": true,
"nextOffset": 25,
"capped": false,
"pageSummary": { "totalEstimatedAmt": 12345678, "byInstitution": { "...": 3 }, "byProgram": { "...": 2 } },
"hint": "Showing 25 of 981 matching awards (offset 0). More results are available: call again with offset=25."
}
Showing 25 of 981 matching awards (offset 0). More results are available: call again with offset=25.
The paging fields are totalResults, hasMore, nextOffset and capped. To get the next page, pass nextOffset as offset.2 capped: true means the API’s 10,000-match cap was reached; narrow the search to reach the rest.4 See Search results for every field.
Search records are summaries by default
Each search record now carries only these fields, in this order (absent values are omitted):5
id, title, pdPIName, coPDPI, awardeeName, awardeeCity, awardeeStateCode, startDate, expDate, estimatedTotalAmt, fundsObligatedAmt, fundProgramName, dirAbbr, divAbbr, transType, activeAwd, hasOutcomesReport
In summaries, coPDPI is a list of names, with ` (Former)` appended for Co-PIs who left the award.5 To get more:
detail: "full"returns every field the API sends, including the abstract, except the publications (jrnl,publicationResearch,publicationConference) and the outcome report HTML (projectOutComesReport). Without them a record is about 3-5 KB, so lowerlimitfor full pages.3 6printFields: "id,title,abstractText,estimatedTotalAmt"returns only the named fields of the normalized full record, includingjrnlorprojectOutComesReportwhen you name them. Use normalized names (piMiddleInitial,hasOutcomesReport); unknown names are ignored.7 6get_award_detailsreturns one full record.
The search tools share these parameters; see Shared search parameters.
get_award_details returns { award }
get_award_details returns { "award": { ... } }.2 The record never includes the outcome report HTML (projectOutComesReport). Publications (jrnl, publicationResearch, publicationConference) are omitted unless includePublications: true. The abstract (abstractText) is included unless includeAbstract: false.8 For the report, call get_project_outcomes; hasOutcomesReport in any record says whether one exists.2 See get_award_details.
get_project_outcomes returns plain text
get_project_outcomes returns { awardId, title, pdPIName, awardeeName, startDate, expDate, outcomesReport }, where outcomesReport is plain text. includeHtml: true adds outcomesReportHtml.2 See get_project_outcomes.
Values are normalized
Every record goes through the same normalization:2
| Field | 2.0.0 value |
|---|---|
estimatedTotalAmt, fundsObligatedAmt |
Numbers in US dollars (they were strings) |
activeAwd, histAwd, publicAccessMandate |
Booleans |
primaryProgram |
Always an array |
pi, coPDPI |
Arrays of { name, email?, former } in full records; summaries list Co-PI names |
piMiddleInitial |
The API’s misspelled piMiddeInitial, renamed |
hasOutcomesReport |
New: true when the award has a Project Outcomes Report |
Fields the API sends as "" |
Dropped |
Dates stay mm/dd/yyyy, and fundsObligated stays a list of strings such as "FY 2011 = $1,498,027.00".7 Each pi and coPDPI entry in a full record has this shape (the values here are placeholders):
{ "name": "First M Last", "email": "name@example.edu", "former": false }
See Award record for every field.
Removed and deprecated parameters
agencyis removed fromsearch_nsf_awards. The API accepts it, but it has no effect.2includeExpiredis deprecated. It remains onsearch_nsf_awardsonly. Usestatusinstead:"active","expired"or"all"(the default).6includeExpired: falsestill means"active". When both are given,statuswins.3statusis also onsearch_by_institutionandsearch_by_pi.2
{ "keyword": "wildfire", "status": "active" }
Stricter input
Arguments are validated before any API call, and invalid ones are rejected with an isError result instead of being dropped silently:2 7
- Dates must be valid
mm/dd/yyyyoryyyy-mm-ddvalues. - A date or amount range whose start is after its end is rejected.
awardIdmust be numeric: 1 to 10 digits, for example2632685.6offsetstops at 9999, because the API serves nothing past record 10,000.limitis 1 to 25.6
For example:7
Input validation error: Invalid arguments for tool search_nsf_awards: startDateTo: startDateFrom (12/31/2024) is after startDateTo (01/01/2020)
Tool failures (an unknown award, an API error) also come back as isError: true results with a message in content[0].text.7 See Errors.
New in 2.0.0
These additions are not breaking, but you may want to use them:2
expDateFromandexpDateToonsearch_by_institutionandsearch_by_pi.cityandestimatedTotalAmtFromandestimatedTotalAmtToonsearch_by_institution.statuson all three search tools.- Resource templates
nsf://award/{id}andnsf://award/{id}/outcomes(see Award resource and Award outcomes resource). - The Streamable HTTP transport (see HTTP transport).
- Output schemas on every tool, so clients receive
structuredContent.4