# Add Malli Schemas to Metabase API Endpoints

Metabase endpoints can fail when request and response schemas do not match runtime data. This skill guides accurate Malli schemas using established project patterns.

## Install

```bash
npx skillstore add metabase/add-malli-schemas
```

## Metadata

- Status: approved
- Slug: metabase-add-malli-schemas
- Skillstore revision: r2
- Version status: missing
- Tree hash: f9d5b57751c1b3c5891b6016d4cd621f3a5a371a2e3d036339ac212c80c7a7e3
- Author: metabase
- GitHub username: metabase
- License: MIT
- Repository: https://github.com/metabase/metabase/tree/master/.claude/skills/add-malli-schemas
- Ref: ebdfe608f5de2b66ff37ab4af12af8ac4f5e8006
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, env\_access
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/metabase-add-malli-schemas
- Manifest: https://skillstore.pages.dev/api/skills/metabase-add-malli-schemas/manifest

## Capabilities

- Identifies route, query, and body parameters for separate Malli validation schemas.
- Defines inline or named response schemas that match returned Clojure data.
- Selects established Metabase schema types from the Malli utility namespace.
- Handles optional fields, nullable values, defaults, enums, sets, and nested maps.
- Explains request and response validation timing before JSON serialization.
- Guides custom validation messages and reusable registered schema definitions.

## Use Cases

- Migrate an endpoint: Add request and response validation to an existing endpoint while preserving Metabase conventions.
- Review schema correctness: Check nullable, optional, temporal, and collection fields against actual handler data.
- Standardize shared schemas: Replace repeated anonymous structures with documented registered schemas across a namespace.

## Prompt Templates

### Add parameter schemas

```
Add request parameter Malli schemas to [endpoint]. Identify route, query, and body parameters, then use existing Metabase schema types where possible.
```

### Define a response schema

```
Add a response schema to [endpoint]. Inspect its implementation and tests, then match the returned Clojure data with an inline or named schema.
```

### Audit schema behavior

```
Review Malli schemas in [file]. Check optional, nullable, default, collection, temporal, and enum handling against Metabase validation timing.
```

### Refactor reusable schemas

```
Refactor repeated endpoint schemas in [namespace]. Define reusable registered schemas, preserve validation messages, and propose focused tests for valid and invalid requests.
```

## Limitations

- The guidance targets Metabase Clojure API conventions and is not a general Malli reference.
- Accurate response schemas require access to endpoint implementations, models, and tests.
- The skill cannot verify runtime behavior without focused tests or trusted REPL inspection.
- It provides guidance and examples, not an automatic schema generation script.

## Best Practices

- Inspect handler return values, models, and tests before defining a response schema.
- Prefer established Metabase types and named schemas for repeated or complex structures.
- Test valid, invalid, omitted, nullable, and defaulted values with focused endpoint tests.

## Anti Patterns

- Do not infer internal response types only from serialized JSON output.
- Do not treat nullable fields and optional fields as equivalent.
- Do not use request temporal string schemas for pre-serialization Java time responses.

## Security Audit

- Audited at: 2026-07-23T17:25:33.808\+00:00
- Summary: All 114 static alerts are false positives caused by Markdown delimiters, Clojure vector syntax, identifier text, and a documentation link. The skill contains no secret access, obfuscation, data exfiltration, prompt injection, or unsafe command construction.

## Stats

- Views: 227
- Downloads: 11
- Favorites: 0
- Popularity score: 0
