get_flag_drift
[MAINTENANCE] 8ca89e8f — read side of link_flag_to_section: for every recorded flag link (optionally scoped to one doc / element_id / flag_name — pass flag_name alone with no doc for the REVERSE query 'flag X changed, which sections does it touch'), re-scan the CURRENT codebase (same AST scan as ...
This record as markdown: /tools/io-github-ajc3xc-meridian/get-flag-drift.md
What get_flag_drift does on Meridian
AI agents call get_flag_drift to retrieve information from Meridian without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
doc | string | — | Optional: scope to links recorded against one stored document (the doc source you ingested it under). |
root_dir | string | — | Absolute path to the source-tree root to re-scan for current flag defaults (same as get_flag_registry's root_dir). Defaults to the server's current working dire |
flag_name | string | — | Optional: scope to links recorded for one flag name — the reverse query, omit 'doc' to search project-wide. |
element_id | string | — | Optional: scope to links recorded against one specific doc_elements id. |
project_id | string | — | |
project_name | string | — | Project name — an alternative to project_id; resolved to the id internally. project_id wins if both are given. |
Parameters from the server's own tool schema.
Why get_flag_drift is rated Low
Despite the complex maintenance operation, get_flag_drift is fundamentally a Read operation: it retrieves flag link records, scans the AST (analysis), and diffs values to detect drift. It does not create, modify, delete, or execute external code—only reports discrepancies.
From the tool's definition Tool performs 're-scan' and 'diff' operations on recorded flag links against current codebase state. Description states it reads flag registry, compares defaults, and reports status—purely informational analysis with no modifications to data or system state.
Risk signalsBulk/mass operation — affects multiple targets
Attacks that exploit this kind of access
The rule that runs get_flag_drift safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Meridian, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For get_flag_drift, this is the rule to start with:
get_flag_drift is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Meridian, apply this rule, and every get_flag_drift call is checked against it from then on.
Questions about get_flag_drift
[MAINTENANCE] 8ca89e8f — read side of link_flag_to_section: for every recorded flag link (optionally scoped to one doc / element_id / flag_name — pass flag_name alone with no doc for the REVERSE query 'flag X changed, which sections does it touch'), re-scan the CURRENT codebase (same AST scan as get_flag_registry) and diff each link's recorded default against what the flag defaults to NOW. Only the most recently recorded link per (element, flag) pair is diffed — a re-verified section's older links are history, not live claims. Each result carries status: 'removed' (the flag, or this exact call site, no longer exists — the strongest staleness signal), 'drifted' (the flag still exists but its default changed since this section was computed — the section is possibly stale, needs re-verification), or 'ok' (no evidence of drift found). Returns {project_id, root_dir, links:[{...link fields, current_default, current_call_sites, status}], summary:{ok, drifted, removed}}. No recorded links returns an empty list, never an error — this is advisory, not a hard gate. It is categorised as a Read tool in the Meridian MCP Server, which means it retrieves data without modifying state.
get_flag_drift accepts 6 parameters: doc, root_dir, flag_name, element_id, project_id, project_name. The full parameter table on this page comes from the server's own tool schema.
Register the Meridian MCP server in PolicyLayer and add a rule for get_flag_drift: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Meridian. Nothing to install.
get_flag_drift is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the get_flag_drift rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for get_flag_drift. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
get_flag_drift is provided by the Meridian MCP server (@meridianmcp/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Meridian, and thousands of servers like it.
This server
Across the catalogue