Sam Search Opportunities
sam_search_opportunitiesSearch active federal contract opportunities by keyword, NAICS code (e.g., "541512"), set-aside type, posting date range, and procurement type. Searches SAM.gov's public Contract Opportunities extract, refreshed daily, without spending an API key, ranking matches by relevance with the opportunity TITLE weighted well above its description, so a genuine title hit outranks a notice whose boilerplate contract-clause text happens to mention the term. Returns titles, solicitation numbers, deadlines, and agencies, plus a mirror field reporting how fresh that snapshot is. SAM.gov requires a posting date range, if you omit posted_from/posted_to, we default to the last 30 days. Accepts query / q / keywords as aliases for keyword.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"limit": 20,
"naics": "541512",
"keyword": "software development",
"posted_to": "12/31/2024",
"posted_from": "01/01/2024"
},
"name": "sam_search_opportunities"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Alias for keyword. | |
| limit | No | Number of results to return (1-100, default 10) | |
| naics | No | NAICS code to filter by (e.g., "541512" for computer systems design). Not sure of the code? naics_search turns industry words into NAICS codes; naics_lookup explains one. | |
| ptype | No | Procurement type filter: p (presolicitation), o (solicitation), k (combined synopsis/solicitation), a (award notice) | |
| query | No | Alias for keyword. | |
| offset | No | Result offset for pagination (default 0) | |
| _apiKey | No | Optional, omit it. This search answers keyless from the local snapshot of SAM.gov's public Contract Opportunities extract; a key is needed only to reach postings newer than that snapshot. | |
| keyword | No | Search term for opportunity title or description. query, q, keywords accepted as aliases. | |
| keywords | No | Alias for keyword. | |
| posted_to | No | End of posting date range in MM/dd/yyyy format. Defaults to today if omitted. | |
| set_aside | No | Small business set-aside type: SBA (Small Business), SDVOSB (Service-Disabled Veteran), HUBZone, 8AN (8(a)), WOSB (Women-Owned), EDWOSB (Economically Disadvantaged Women-Owned) | |
| posted_from | No | Start of posting date range in MM/dd/yyyy format. Defaults to 30 days ago if omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | Yes | Number of results returned in this request | |
| offset | Yes | Offset used for pagination | |
| opportunities | Yes | ||
| total_records | Yes | Total number of matching opportunities in SAM.gov |