Metadata-Version: 2.5
Name: ohdsi-prompt-registry
Version: 0.2.0
Summary: Groundworkers registry for agent-facing OHDSI prompt packs.
Requires-Python: >=3.12
Requires-Dist: groundworkers[tui]<1,>=0.5
Requires-Dist: jsonschema<5,>=4
Requires-Dist: mcp<2,>=1
Requires-Dist: oa-configurator<2,>=1.2.1
Requires-Dist: pydantic<3,>=2
Requires-Dist: pyyaml>=6
Provides-Extra: dev
Requires-Dist: mkdocs-material; extra == 'dev'
Requires-Dist: mkdocs<2.0; extra == 'dev'
Requires-Dist: mkdocstrings[python]; extra == 'dev'
Requires-Dist: pygments>=2.20.0; extra == 'dev'
Requires-Dist: pytest<10,>=9; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: ty>=0.0.59; extra == 'dev'
Description-Content-Type: text/markdown

# OHDSI Prompt Registry

The OHDSI Prompt Registry makes reviewed prompt workflows discoverable through Groundworkers MCP. A pack can publish instructions, JSON Schemas, examples, deterministic Markdown rendering, and an optional user-facing MCP prompt.

To see what is available before choosing a workflow:

Call `ohdsi_prompt_registry_catalogue` with:

```json
{}
```

The response lists each active pack, its scope, tags, source, documents, schemas, prompts, renderers, and advertised tool dependencies. Filter by a tag when the catalogue is large:

Call it with a tag filter:

```json
{"tags": ["concept-mapping"]}
```

Then inspect the pack’s manifest and instructions. A resource-capable client can read the URIs returned in the catalogue. A client without resource browsing can ask for links:

Call `ohdsi_prompt_registry_links` with:

```json
{"pack": "omop-concept-grounding"}
```

The registry also exposes a small, stable tool surface:

| Tool | Use it for |
| --- | --- |
| `ohdsi_prompt_registry_catalogue` | Find packs by scope or tag. |
| `ohdsi_prompt_registry_links` | Get the manifest, documents, and schemas for one pack. |
| `ohdsi_prompt_registry_validate` | Check a request or result against a pack schema. |
| `ohdsi_prompt_registry_render` | Turn a valid document into a human-readable Markdown review. |
| `ohdsi_prompt_registry_status` | See active packs, rejected packs, overrides, and missing tool dependencies. |

Declared workflows appear in the MCP prompt list. Current examples include:

```text
rqt_structure_question   # bundled research-question workflow
ocg_ground_concepts      # installed concept-grounding workflow
gdc_classify_fields      # filesystem Groundcrew workflow
gsc_classify_columns     # filesystem Groundcrew workflow
```

Invoke a prompt by its published name. Prompt arguments are strings; JSON inputs are passed as JSON text:

Call `ocg_ground_concepts` with:

```json
{
  "mapping_request": "{\"items\":[{\"item_id\":\"dx-1\",\"label\":\"Type 2 diabetes mellitus\"}]}"
}
```

For a workflow that returns a JSON document, validate it before treating it as an operational handoff:

Call `ohdsi_prompt_registry_validate` with:

```json
{
  "pack": "omop-concept-grounding",
  "schema": "mapping_decision",
  "document": "{...}"
}
```

The instructions in each pack state which schemas and domain tools apply. The registry supplies the current schema at read time, so the instructions and contract do not need to be kept in separate prompt copies.

## Documentation

Full documentation: <https://AustralianCancerDataNetwork.github.io/ohdsi-prompt-registry>

- **[Pack sources](https://AustralianCancerDataNetwork.github.io/ohdsi-prompt-registry/sources/)** — bundled, installed, and filesystem packs, and which one wins when two packs share a name.
- **[Pack format](https://AustralianCancerDataNetwork.github.io/ohdsi-prompt-registry/pack-format/)** — the manifest contract every source uses, and how to extend a pack safely.
- **[Development](https://AustralianCancerDataNetwork.github.io/ohdsi-prompt-registry/development/)** — the local loop, versioning, and the release process.

## Development

```bash
uv sync --all-extras --dev
uv run ruff check .
uv run ty check src/
uv run pytest -q
```

Enable the `uv.lock` sync hook once per clone:

```bash
git config core.hooksPath .githooks
```

Contribution and labelling rules are in [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md).
