Match Terms to a Value Set
match_value_setMaps free-text terms to matching codes from a supplied value set, ranking only validated allowed codes by lexical and synonym matches so field contents can be standardized.
Instructions
For each free-text term, pick the best code FROM A VALUE SET YOU PROVIDE — the question "which code of this value set fits this field?".
Send terms (up to 50) and value_set: the allowed codes as { code, terminology } pairs (up to 100; any of icd11, icd10, cid10, loinc, rxnorm, mesh, atc, icf, mixed if needed). Only those codes can be suggested — never a code outside the set.
How it works: every member is first confirmed at its source (the validate_codes logic), giving its official title and FHIR coding; members that do not exist or cannot be checked are listed in value_set.unconfirmed and never ranked. Then each term is scored against each confirmed member's title AND the synonyms its source publishes (ICD-11/ICF inclusions and index terms, LOINC related names, MeSH entry terms): match_score (lexical, 0-1), match_type (exact / strong / needs_review, the harmonize_terms rules) and matched_label (the synonym that scored, or null when the title did). Members sharing no word with the term are left out; a term with none left is no_candidates.
Lexical only: a synonym the source does NOT publish ("gait speed" for "walking speed") lands in needs_review or no_candidates — review those with a person. Each member is looked up live (cached), so a large set of ICD-11/ICF codes takes a few seconds.
When NOT to use: with no value set, map terms with harmonize_terms; to check a list of codes, use validate_codes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"terms": "<terms>",
"value_set": "<value_set>"
},
"name": "match_value_set"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| terms | Yes | Free-text terms to place in the value set (e.g. the field contents of your data). Up to 50. | |
| value_set | Yes | The allowed codes, as code+terminology pairs (any of the validate_codes terminologies, mixed if needed). Only these codes can be suggested. Up to 100; each is confirmed at its source before ranking. | |
| max_candidates | No | Ranked members returned per term (1-10, default 3). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| counts | Yes | How many terms landed in each class (by their best member). | |
| results | Yes | One entry per term, in request order. | |
| value_set | Yes | What happened to the value set before ranking. | |
| provenance | Yes | One provenance block per upstream source that contributed to this response (licenses are never merged; each block carries the origin diagnostics of ITS source) | |
| attribution | Yes | Canonical source URLs of this response (attribution list) |