S1000D BREX (S1000D Stack)

v0.13.0
io.github.shuji-bonji/s1000d-brex-mcp Checked 4 days ago Published 2 days ago

Read S1000D BREX business rules and check data modules against them, layer by layer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

explain_brex

List the rules of a BREX data module in readable form: for each rule, the target (XPath), whether it is forbidden / required / optional, the allowed values with their meanings, severity, and the schema context it applies to. Also returns the BREX header (DMC, parent BREX, commonInfo, counts). Use "kind" and "context" to narrow, "offset"/"limit" to page. The header carries the whole commonInfo text whatever "limit" is; pass includeCommonInfo: false to get its length instead.

ParameterTypeDescription
brexstringWhich BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to…
contextstringOnly rules that apply to this schema (file name such as "descript", "proced", "pm") plus the common rules. Omit for all contexts.
csdbDirsarrayCSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a…
includeCommonInfobooleanReturn the commonInfo text of the BREX in the header (default true). Pass false to get "commonInfoLength" (number of characters) instead, for example when reading further pages of the same BREX.
kindstringRule kind to list (default: all).
limitnumberMaximum rules to return (default 50, max 500).
offsetnumberIndex of the first rule to return (default 0).
searchstringCase-insensitive text to find in objectPath, objectUse, rule id or value meanings.

lookup_sns

Explain what a Standard Numbering System (SNS) code means in a BREX: pass a DMC (the system / subsystem / sub-subsystem / assembly codes are taken from it) or the codes directly. Returns the matched hierarchy with titles; "exact: false" means only a prefix matched.

ParameterTypeDescription
assyCodestringAssembly code (2 or 4 characters).
brexstringWhich BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to…
csdbDirsarrayCSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a…
dmcstringA DMC whose SNS part should be looked up.
subSubSystemCodestringSub-subsystem code (1 character).
subSystemCodestringSubsystem code (1 character).
systemCodestringSystem code (2-3 characters), when not passing dmc.

lookup_value

Explain what a value of an element or attribute means in a BREX, or list the allowed values. Pass "target" as an attribute name (e.g. "securityClassification"), an element name, or an XPath fragment; optionally "value" to check one value. Returns the matching rules with allowed values and their meanings, and whether the value is allowed.

ParameterTypeDescription
target *stringAttribute name ("infoCode", "@infoCode"), element name ("language"), or XPath fragment to match against objectPath.
brexstringWhich BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to…
contextstringSchema file name (e.g. "descript") to pick context-specific rules in addition to common ones.
csdbDirsarrayCSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a…
valuestringThe value to check against the allowed values (optional).

list_notations

List the illustration / multimedia notations (file formats) a BREX allows: the base set (common to all schemas) and the per-schema additions and exclusions. Pass "context" to get the effective rule for one schema: mode "closed" (only the listed notations may be used), "open" (only the excluded ones are forbidden; a BREX with exclusions only) or "unrestricted". Returns an empty base set when the BREX has no notation rules (then the BREX does not restrict notations).

ParameterTypeDescription
brexstringWhich BREX to use: a file path to a BREX data module (.xml), or a DMC (e.g. "KENBAIKI-A-00-00-00-00A-022A-D", "DMC-" prefix optional) searched in csdbDirs / S1000D_CSDB_DIR / S1000D_SPEC_DIR. Omit to…
contextstringSchema file name (e.g. "ipd", "proced") to compute the effective set for.
csdbDirsarrayCSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a…

check_against_brex

Check a data module against BREX rules and report violations with location (XPath + line), actual value, rule id, objectUse text and severity. Also accepts a publication module (pm) or a comment (the brexDmRef in pmStatus / commentStatus is followed). By default follows the document's brexDmRef chain (project BREX → … → the BREX that ends the chain by referring to itself: usually the S1000D default BREX found under S1000D_SPEC_DIR) and checks each layer separately; pass "brex" to check against one specific BREX instead or in addition. Does NOT validate against the XML schema (XSD): run s…

ParameterTypeDescription
brexstringA specific BREX (file path or DMC) to check against. With followChain=false it is the only layer; otherwise it is added to the chain.
csdbDirsarrayCSDB folders to search for BREX by DMC (default: S1000D_CSDB_DIR / the config file; S1000D_SPEC_DIR is always searched for the S1000D default BREX). When given, these folders replace S1000D_CSDB_DIR a…
followChainbooleanFollow the brexDmRef chain of the data module (default true).
includeManualChecksbooleanInclude nonContextRules as manualChecks in each layer (default true).
maxViolationsPerLayernumberCap on violations returned per layer (default 200). The total count is always reported.
pathstringFile path of the data module to check.
xmlstringThe data module as an XML string (alternative to path; max 5 MB).