Parse a MIF issue body with parse_mif_issue_body
Goal: read an issue or discussion body’s raw text and extract its MIF
metadata (id, type, namespace) plus the body with the frontmatter
comments stripped out.
Prerequisites
Section titled “Prerequisites”- None — this is a pure string-transformation function; it makes no GitHub API call. It works on any raw body text, whether or not it actually carries MIF frontmatter.
-
Call
parse_mif_issue_bodywith the raw body text (for example, fetched separately viagh issue view <number> --json body -q .body, a direct GitHub API read, or a body you already have in hand from a priorcreate_issuecall, which returns the body it created —update_issuereturns only{ number, url }, not the body):{"raw": "<!-- mif-id: urn:mif:concept:your-repo:flaky-upload-retry -->\n<!-- mif-type: Bug -->\n<!-- mif-ns: your-repo -->\nUploads intermittently fail on slow connections."} -
Read the result:
{"meta": { "id": "flaky-upload-retry", "type": "Bug", "namespace": "your-repo" },"body": "Uploads intermittently fail on slow connections."}
Verify it worked
Section titled “Verify it worked”meta.idis the slug portion only (not the fullurn:mif:concept:...string).- If the raw text is missing any one of the three comment lines,
metaisnullandbodyis returned unchanged (the whole input, untouched) — this is how you detect a non-MIF-conformant body, not an error.
See also: tool reference.