Skip to main content
Glama
Nizoka

pkinative-mcp

Check certificate purpose (extended key usage along the path)

check_certificate_purpose
Read-onlyIdempotent

Judge whether a certificate and its issuer chain permit a specific purpose such as serverAuth or codeSigning, returning valid:false with reasons when extKeyUsage blocks it.

Instructions

The RFC 5280 §4.2.1.12 purpose verdict: may certificate be used for purpose (serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, ocspSigning, any, or a dotted KeyPurposeId OID)? The path judged is [certificate, ...chain] (issuers, leaf's issuer first): under restrictIssuers (default true, what every Web PKI validator does) a CA's own extKeyUsage restricts what it issued; requireExplicitPurpose (default false) refuses a certificate with no extKeyUsage instead of reading its absence as unrestricted. A negative verdict is valid:false + reasons[] (PKI_REASON_PURPOSE_NOT_PERMITTED with the path[i] element) in structuredContent — never isError; an unknown purpose name is VALIDATION_ERROR. The purpose only: not trust, validity, names or revocation (verify_certificate_chain with purposes is the full verdict). Token-frugal: verbosity:'summary'.

Input Schema

NameRequiredDescriptionDefault
chainNoThe issuing certificates, leaf's issuer first (the path is [certificate, ...chain]) (every PEM block of every item is taken). Optional; their extKeyUsage restricts the leaf under restrictIssuers.
fieldsNoDot-paths to keep after verbosity (arrays map over elements); unmatched paths land in _meta.unmatchedFields.
limitsNoRaise pkinative's 22 named security bounds for this call (trusted input only; absent keys keep the engine defaults). A value above an operator ceiling (PKINATIVE_MCP_MAX_INPUT_BYTES, PKINATIVE_MCP_MAX_KDF_ITERATIONS, PKINATIVE_MCP_MAX_PATHS_EXPLORED) is LIMIT_CEILING_EXCEEDED; describe_engine lists the defaults and the ceilings.
strictNoEscalate the first engine warning to a PKI_STRICT_DIAGNOSTIC error instead of listing it in diagnostics[].
pemModeNo'strict' (RFC 7468 exactly, default) or 'lax' (tolerates whitespace, line length and RFC 1421 headers).strict
purposeYesThe purpose needed: serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, ocspSigning, any, or a dotted KeyPurposeId OID.
verbosityNo'summary' keeps the scalar fields only (token-frugal).full
certificateYesThe end-entity certificate to judge: exactly one of pem / derBase64 / path.
encodingRulesNo'der' (strict X.690 DER, default) or 'ber' (indefinite / non-minimal lengths and constructed strings, as legacy CMS producers write).der
restrictIssuersNoApply a CA's own extKeyUsage to what it issued (what every Web PKI validator does; no sentence of RFC 5280 requires it). Default true; false is the literal-RFC reading.
requireExplicitPurposeNoRequire the certificate to carry extKeyUsage and name the purpose explicitly (the stricter Web PKI reading); default false = no extKeyUsage means unrestricted (RFC 5280 §4.2.1.12).

Output Schema

NameRequiredDescriptionDefault
validNoThe verdict. false is a negative verdict (reasons[]), never an error.
purposeNoThe purpose as given.
reasonsNoWhy the verdict is negative (empty when valid): the engine PKI_REASON_* codes, each with the standard it cites and the path of the offending element. A reason is returned, never thrown.
subjectNoRFC 4514 subject of the certificate.
pathLengthNo1 + the chain certificates (reasons name path[i]).
purposeOidNoThe KeyPurposeId OID judged.
diagnosticsNoNon-fatal concerns the engine raised (PKI_DIAG_*, de-duplicated, at most 200; explain_code explains one).
purposeNameNoThe registry name of that OID.
reasonCodesNo
diagnosticCountNo
diagnosticCountsNoOccurrences per diagnostic code.
diagnosticsTruncatedNotrue when distinct diagnostics beyond the 200 listed were dropped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnly, idempotent, non-destructive), and the description adds genuinely new behavior: a negative verdict arrives as valid:false plus reasons[] with PKI_REASON_PURPOSE_NOT_PERMITTED and the offending path[i], never as isError, while an unknown purpose name is a VALIDATION_ERROR. It also discloses the two policy flags' defaults and their real-world meaning. It does not discuss failure modes such as unparsable certificates or path-length violations, which keeps it just short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single dense paragraph, but front-loaded: the verdict question, the path shape, then the two policy flags, then the return/error contract, then the scope exclusion. The purpose enumeration is duplicated verbatim in the schema and the sentence about restrictIssuers partly restates its parameter description, so a small amount of text does not earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter tool with nested certificate/chain objects and an output schema, the description covers the path ordering ([certificate, ...chain], issuer-first), the input alternatives (pem/derBase64/path), the verdict contract, and the boundary against the broader verification tool. Since an output schema exists, it need not enumerate return fields, and it appropriately does not.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining the semantic consequence of `restrictIssuers` (a CA's extKeyUsage constrains what it issued, the Web PKI validator behavior, versus the literal-RFC reading) and `requireExplicitPurpose` (absence of extKeyUsage treated as unrestricted by default). It also enumerates the accepted purpose values and points at verbosity:'summary' for token frugality, though the 22 `limits` knobs and `fields` dot-paths are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource: the RFC 5280 §4.2.1.12 'purpose verdict' answering whether `certificate` may be used for `purpose`. It explicitly scopes itself against the sibling that gives the full verdict (`verify_certificate_chain with purposes`), so an agent can pick the right tool without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states both when to use it (extKeyUsage/purpose judgment along a path) and when not to: 'The purpose only: not trust, validity, names or revocation (verify_certificate_chain with purposes is the full verdict).' That is an explicit exclusion plus a named alternative, which is the top of the scale.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.