Shared search parameters

Reference

Paging, record shaping, status and date and amount range parameters that the three search tools share, with their defaults, limits and NSF API mappings.

Status
stable
Trust tier
unverified
Generated
claude-code/claude-opus-5-5, 2026-12-05
Tags
searchpagingparameterstools

The three search tools, search_nsf_awards, search_by_institution and search_by_pi, are built from the same Zod schema pieces: paging (offset, limit), record shaping (detail, printFields), the status filter, and the start and expiration date ranges. Two of them also share the estimated amount range.1 This page documents those parameters once. Each tool page lists only its own parameters and links here.

The MCP SDK validates arguments against these schemas and applies the defaults before a handler runs. A bad date, a reversed range, a limit outside 1 to 25 or an unknown status is rejected as a tool error before any request reaches the NSF API.2 Unknown argument names, for example the removed agency, are stripped silently rather than rejected.2

Tool argument names are not always NSF API parameter names. The handlers rename them: limit becomes rpp, the *From/*To date bounds become *Start/*End, and status becomes ActiveAwards or ExpiredAwards. detail and printFields are never sent to the API, because the server applies them to the records it gets back.3 For the API side of these parameters, see Search parameters and Paging and limits.

Availability

Parameter search_nsf_awards search_by_institution search_by_pi
offset, limit yes yes yes
detail, printFields yes yes yes
status yes yes yes
startDateFrom, startDateTo yes yes yes
expDateFrom, expDateTo yes yes yes
estimatedTotalAmtFrom, estimatedTotalAmtTo yes yes no

search_nsf_awards also has the action date range (dateStart, dateEnd), the obligated amount range (fundsObligatedAmtFrom, fundsObligatedAmtTo) and the deprecated includeExpired flag. Those are documented on its own page.1

Schema

Descriptions are the exact strings in the Zod schemas, which clients see in tools/list.1

Parameter Type Default Constraints NSF API parameter Description
offset integer 0 0 to 9999 offset 0-based record offset for paging (use nextOffset from the previous result)
limit integer 25 1 to 25 rpp Results per page (1-25)
detail "summary" \| "full" "summary" one of the two values none (applied by the server) summary (default): compact records (id, title, PI, institution, dates, amounts, program, status). full: complete records with the abstract, about 3-5 KB each, so lower limit; publications and the outcomes report are left out (name them in printFields, or use get_award_details / get_project_outcomes)
printFields string none comma-separated field names none (applied by the server) Comma-separated fields to return instead of the detail preset, e.g. “id,title,abstractText,estimatedTotalAmt” (any field of the full record, including jrnl and projectOutComesReport)
status "active" \| "expired" \| "all" none (treated as all) one of the three values ActiveAwards or ExpiredAwards Award status filter (default all)
startDateFrom string (date) none valid date; not after startDateTo startDateStart Award start date on or after (mm/dd/yyyy or yyyy-mm-dd)
startDateTo string (date) none valid date startDateEnd Award start date on or before (mm/dd/yyyy or yyyy-mm-dd)
expDateFrom string (date) none valid date; not after expDateTo expDateStart Award expiration date on or after (mm/dd/yyyy or yyyy-mm-dd)
expDateTo string (date) none valid date expDateEnd Award expiration date on or before (mm/dd/yyyy or yyyy-mm-dd)
estimatedTotalAmtFrom number none >= 0; not greater than estimatedTotalAmtTo estimatedTotalAmtFrom Minimum estimated total award amount in US dollars
estimatedTotalAmtTo number none >= 0 estimatedTotalAmtTo Maximum estimated total award amount in US dollars

Paging: offset and limit

Each call returns one page of at most 25 records. To get the next page, call again with offset set to the nextOffset of the previous result. nextOffset is offset + returned, and it is present only when hasMore is true.3

  • offset is a 0-based record offset. Its maximum is 9999 because the API serves no record past record 10,000.1
  • limit is sent to the API as rpp. The client clamps rpp to 1 to 25. It also shortens a page that would reach past record 10,000 so that it ends at the cap, because the API answers such a request with an AwardAPI-004 error and no records. For example, offset: 9990 returns the last 10 records.4 5
  • hasMore is false for an empty page and when the next offset would be at or past record 10,000, even if more records match.6
  • totalResults is the API’s metadata.totalCount, which the API caps at 10,000. capped is true when totalResults >= 10000. Then narrow the search (a keyword, a state or a date range) to reach the rest.3
  • The API orders results by startDate, newest first, but the order of awards with equal start dates is not stable between calls. A page boundary can therefore repeat or skip an award.7 5

search_by_pi with includeCoPIs: true pages differently: it fetches the whole merged result and applies offset and limit to it locally. See search_by_pi.

The full envelope (awards, totalResults, offset, limit, returned, hasMore, nextOffset, capped, pageSummary, hint) and the paging hint text are documented in Search results.

Record shaping: detail and printFields

Every search record starts as the normalized full record (see Award record). The server then shapes each record in this order:3

  1. If printFields is set, keep only the named fields. printFields wins over detail.
  2. Otherwise, with detail: "full", return the normalized record without the outcomes report HTML (projectOutComesReport) and the publication fields (jrnl, publicationResearch, publicationConference). With them, one record could reach about 75 KB; without them it is about 3-5 KB.3 1
  3. Otherwise (the default detail: "summary"), return a summary record.

Summary records keep these fields, in this fixed order, and omit absent values: id, title, pdPIName, coPDPI, awardeeName, awardeeCity, awardeeStateCode, startDate, expDate, estimatedTotalAmt, fundsObligatedAmt, fundProgramName, dirAbbr, divAbbr, transType, activeAwd, hasOutcomesReport. In a summary, coPDPI is a list of names (no emails), with ` (Former)` appended for Co-PIs who left the award.8

printFields is split at commas, each name is trimmed, and empty names are dropped. Names that are not fields of the record are ignored. The projection reads the whole normalized record, so it can still name the fields that detail: "full" leaves out, such as jrnl or projectOutComesReport.6 Use normalized names such as piMiddleInitial and hasOutcomesReport, and expect coPDPI as a list of { name, email, former } objects.8 5 Use printFields when you need one or two extra fields across many awards: a detail: "full" record includes the abstract and every other field except the outcomes report and publications.5 3 For those, name them in printFields or call get_award_details (includePublications) or get_project_outcomes.

The NSF API has its own printFields parameter, but it is ignored (full records always come back), so the server never sends it.7

pageSummary is computed from the full records before shaping. Its totalEstimatedAmt is therefore correct even when printFields leaves estimatedTotalAmt out of the returned records.6

Status

status maps to the API’s status flags:3

status API parameters sent
"active" ActiveAwards=true
"expired" ExpiredAwards=true
"all" or absent neither flag

On the live API, ActiveAwards=true and ExpiredAwards=true filter by status, and the two counts add up to the unfiltered count.7 search_nsf_awards also accepts the deprecated includeExpired boolean. An explicit status always wins over it.6

Date ranges

Date parameters accept mm/dd/yyyy or yyyy-mm-dd. The validator also accepts m/d/yyyy and ISO 8601 date-times. A date-time with an explicit zone (for example 2024-01-15T00:00:00Z) stands for its UTC calendar day. Impossible dates such as 2020-02-30 or 13/01/2020 are rejected, never rolled over.9 The schema keeps the value as given, and the client converts it to the mm/dd/yyyy form the API requires.2 4

An invalid date fails validation with the message Invalid date: expected mm/dd/yyyy or yyyy-mm-dd, so a typo cannot silently turn into an unfiltered search.1

Both bounds of a range are optional. When both are given, the start must not be after the end. A single-day range (equal bounds) is allowed.2 A reversed range fails with this message, reported on the *To field:1

startDateFrom (06/01/2024) is after startDateTo (01/01/2024)

startDate and expDate are the award’s start and expiration dates. The action date range dateStart/dateEnd (only on search_nsf_awards) filters the record’s date field instead.7

Amount ranges

Amounts are non-negative numbers in US dollars.1 Equal bounds are allowed, and a negative amount is rejected.2 When both bounds are given and the minimum is larger, validation fails with a message such as:1

estimatedTotalAmtFrom (2000000) is greater than estimatedTotalAmtTo (100000)

Examples

A second page of 10 active awards that started in 2024, with three extra fields per record:

{
  "keyword": "wildfire",
  "status": "active",
  "startDateFrom": "2024-01-01",
  "startDateTo": "12/31/2024",
  "printFields": "id,title,estimatedTotalAmt",
  "offset": 10,
  "limit": 10
}

The search_nsf_awards handler sends these NSF API parameters (the client then rewrites the dates as 01/01/2024 and 12/31/2024):3 4

keyword=wildfire  startDateStart=2024-01-01  startDateEnd=12/31/2024  ActiveAwards=true  offset=10  rpp=10

An invalid argument is reported as a tool error before any API call. With a reversed start date range, the error text reads:5

Input validation error: Invalid arguments for tool search_nsf_awards: startDateTo: startDateFrom (12/31/2024) is after startDateTo (01/01/2020)
  1. Tool input and output schemas ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9

  2. Input and output schema tests ↩ ↩2 ↩3 ↩4 ↩5

  3. Shared tool helpers (record shaping, status mapping, search envelope, paging hint) ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8

  4. NSF API client ↩ ↩2 ↩3

  5. User guide ↩ ↩2 ↩3 ↩4 ↩5

  6. Shared tool helper tests ↩ ↩2 ↩3 ↩4

  7. Live API behaviour notes in CLAUDE.md ↩ ↩2 ↩3 ↩4

  8. Award normalization, summary fields and field projection ↩ ↩2

  9. Date parsing and normalization ↩

Sources

  1. Tool input and output schemas tool-schema
  2. Shared tool helpers (record shaping, status mapping, search envelope, paging hint) shared-tools
  3. NSF API client api-client
  4. Award normalization, summary fields and field projection normalize
  5. Date parsing and normalization date-utils
  6. Input and output schema tests schema-tests
  7. Shared tool helper tests shared-tests
  8. User guide usage-guide
  9. Live API behaviour notes in CLAUDE.md api-behaviour