Skip to content

MCP tools

dicom-kb mcp serve registers seven tools. Each returns one markdown text block that ends with a Source: line. The server registers no resources or prompts.

Tool Arguments Answers
dicom_element name, iod? A data element and where PS3.3 uses it
dicom_iod name, expand = false, type?, usage?, module?, page = 1 An IOD’s modules, or its attribute checklist
dicom_module name, detail = "outline", type?, page = 1 A module’s or macro’s attributes
dicom_values name, within?, page = 1 What an attribute may hold
dicom_code query, scheme?, page = 1 Context groups, templates and codes from PS3.16
dicom_search query, part?, limit = 10 Ranked sections and tables
dicom_read ref, page = 1 A section, table, UID or VR as markdown

Each tool matches the CLI command of the same name without the dicom_ prefix and calls the same resolver.

Looks up a data element by tag ((0028,0030)), keyword (PixelSpacing) or name (Pixel Spacing). Returns its VR, VM and retired status from PS3.6, then every PS3.3 module and macro that uses it with its Type, and the IODs that reach those modules.

With iod, the answer is the element’s place in that one IOD instead: its Type, the sequence it is nested in, its condition, and the module and macro that bring it in.

Takes an IOD name (CT Image), or a SOP Class name, UID or keyword. Returns the IOD’s SOP Classes and its modules with their usage: M, U, or C with the condition. Multi-frame IODs also list their functional group macros.

With expand = true, the answer lists the attributes of the IOD’s M and C modules, with macros expanded in place and each macro listed once: the checklist for building or validating an instance. Conditional attributes show their condition, and descriptions are left to dicom_module. Three arguments narrow it, and any of them turns on expand:

  • type keeps attributes of some Types: required (1, 1C, 2 and 2C) or a list such as 1,1C. A row counts only if every sequence it sits in is of those Types too.
  • usage sets the module usages to include. The default is M,C; M,C,U adds the U modules.
  • module keeps only the modules it names, comma-separated.

The answer ends with what it left out: the modules not shown, or the count of attributes of other Types and the sequences that hide more of the kept Types. The full CT Image checklist is 6 pages; with type = "required" it is 2 pages (about 3,700 tokens).

Takes a module or macro name (General Series, Code Sequence Macro) or a table (Table C.7-5a). Returns a table of keyword, tag, VR, VM, Type and description for each attribute.

By default the answer is an outline: the module’s own rows, each included macro as one line with its attribute count, and each description cut to its first sentence and condition. General Series is one page (about 1,200 tokens) as an outline.

  • detail = "full" expands each macro where it is included, with full descriptions. A macro included again is marked “listed above”. General Series is two pages in full.
  • type keeps attributes of some Types, as for dicom_iod, with macros expanded.

Takes a tag, keyword or name. Returns the attribute’s Enumerated Values and Defined Terms with their meanings, whether the standard lists them in a table cell or in a section. For a code sequence, it names the Baseline or Defined context group (BCID or DCID) that each module or macro gives it.

within takes an IOD, module or macro (CT Image) and keeps only the lists that apply there.

Takes:

  • a context group, as CID 4031 or its name: its codes, with included groups expanded once;
  • a template, as TID 1500 or its name: the template’s section;
  • a code value, as 121071, (121071, DCM) or (121071, DCM, "Finding"): its meaning, its PS3.16 Annex D definition when it has one, and the groups that list it. scheme (DCM, SCT) narrows a code value that more than one scheme uses.

Full-text search over every section and table of all parts. Returns up to limit hits (at most 30), normative text first, each with a ref to pass to dicom_read, its title and a snippet. Informative annexes are marked (informative). part (PS3.5) limits the search to one part.

When no node contains every word, the answer says so and ranks nodes that contain any of them.

Reads a node of the standard as markdown, with every cross reference kept as its target (See Section C.7.3.1.1.1). ref takes:

  • a section, with or without its part: PS3.5 7.5.2, C.7.6.3.1.4;
  • a table: Table C.7-5a, PS3.6 Table 6-1;
  • an annex or chapter: PS3.3 Annex A;
  • a context group or template: CID 7010, TID 1500;
  • a UID, UID keyword or UID name: its PS3.6 registry entry. A transfer syntax adds its VR style, byte order, Pixel Data encoding and deflate, as PS3.5 Annex A states them, with the section that holds the full rules;
  • a VR code (OB, VR OB): its row of PS3.5 Table 6.2-1 and its Explicit VR header layout.

A node that fits in one page is returned whole with its subsections. A larger one returns its own text and lists its subsections to read next.

dicom_iod, dicom_module, dicom_values, dicom_code and dicom_read split long answers into pages of about 16,000 characters (about 4,000 tokens), at block boundaries. A paged answer ends with the next call to make:

Page 1 of 2. Next: dicom_module("General Series", detail="full", page=2).

An ambiguous or unknown name returns a short message and the closest matches instead of a guess:

No data element is named 'Pixel Spaceing'. Closest: Pixel Spacing; PixelSpacing; ALinePixelSpacing; Imager Pixel Spacing; A-line Pixel Spacing.

A section label used in several parts, such as 7.5.2, lists the parts that have it and asks for one.