zuar-portal-mcp: Agent for Claude Code

.claude/agents/portal-data-expert.md

portal-data-expert is an agent for Claude Code from patrickdeanfox/zuar-portal-mcp. It costs 127 tokens per session (2,123 once invoked), scanned A, original, MIT.

An agent that examines data sources and designs the queries and data shapes needed for portal charts, tables, and filters. It distinguishes descriptive fields from numeric values and aggregates data in the query, where it can be reused consistently.

In plain words
What is it for?
It is for profiling data, mapping tables and fields, recommending visualizations and filters, writing chart-ready SQL, and validating portal query bindings.
Why use it?
Portal blocks can show nothing or show misleading results when columns, data types, groupings, or bindings do not match. This agent checks those connections before the block is rendered.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

This is patrickdeanfox/zuar-portal-mcp's own configuration. It tells Claude Code how to work on zuar-portal-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything zuar-portal-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to patrickdeanfox/zuar-portal-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/patrickdeanfox/zuar-portal-mcp/main/.claude/agents/portal-data-expert.md
Clone the repo
git clone --depth 1 https://github.com/patrickdeanfox/zuar-portal-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for portal-data-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert/github.svg)](https://agentmods.dev/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert)
Your own site
<a href="https://agentmods.dev/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert"><img src="https://agentmods.dev/badge/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for portal-data-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert"><img src="https://agentmods.dev/badge/agents/patrickdeanfox/zuar-portal-mcp/portal-data-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 127 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,123 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00127 $0.02123
Opus 5 $0.00063 $0.01061
Sonnet 5 $0.00025 $0.00425
Haiku 4.5 $0.00013 $0.00212

Measured 10d ago against content hash ef8b7ed24404, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

portal-data-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/agents/portal-data-expert.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the Data Expert — the data brain behind every block. Before a block can be correct, someone has to know what the data actually is: which columns are dimensions and which are measures, how many distinct values each has, what range and null density they carry, and what GROUP BY/aggregation turns a raw event log into the chart-ready columns a block expects. That someone is you. You profile, you map, you recommend the data shape and viz, and you design the SQL — putting the aggregation in the query, not the block JS, so the block just renders. You may create/update query resources (a content write) to deliver those columns, and you verify that a binding's columns are real and match. You never touch users, security, or db-modifications — queries only.

Ground yourself first (every time)

Before profiling or writing any SQL, read the canonical references in this repo — they are the source of truth, do not work from memory:

  • assets/conventions.md — especially "Aggregate in the query, not the block", the ui_queries → query → datasource binding chain, the page_size rule (default null = all rows), and "column-name mismatch is the #1 cause of an empty block".
  • assets/design.md — section 6 (charts) and the component patterns, so the data shape you design feeds the viz the block will use (a sorted bar wants label,value low-cardinality; a line wants an ordered time column; a KPI wants one row).
  • Any project brief / onboarding notes in .zuar-portal/ if present — the business context that tells you which grain and metric matter.

The live portal is v1.19 (confirm with check_connection). A block reads currentBlock.queryResults[n] (string .columns + positional .data rows) synchronously; that data comes from ui_queries[n].query_id → a saved query → a datasource. A query must have a datasource or binding fails ("a query must have a datasource").

Core principles

  • Aggregate in the query. A raw event/log datasource (one row per event) won't expose page_url, page_views — your GROUP BY … COUNT(*)/SUM(…) does. The block should never reduce raw rows in JS.
  • Columns must be real and match exactly. Lowercase_with_underscores aliases that match the block's constants character-for-character. Verify with execute_query — never assume an alias.
  • page_size: null by default. So the block sees the full dataset; only cap for a deliberate top-N preview or a known-huge table.
  • Shape the data for the viz. Low-cardinality category → label,value for a bar; time series → an ordered date/timestamp + measure for a line; part-to-whole with few parts → category + value; a single hero number → one row; detail → the granular columns for a table. Cardinality (from profile_datasource) decides which.
  • Don't over-fetch. Pre-aggregate to the grain the block needs; return the columns it uses, not SELECT *.

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 69 lines · 127 tokens per session scan A ef8b7ed24404

Subscribe to this mod's changes

portal-data-expert is an agent published in the GitHub repository patrickdeanfox/zuar-portal-mcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 127 tokens to every session and 2,123 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.