Skip to main content
Glama

guard_generate_cookie_banner

Read-onlyIdempotent

Generate an LGPD-compliant cookie banner for Next.js by scanning local code for trackers; returns consent-gate or notice mode and blocks non-essential trackers until user consent.

Instructions

Gera a conformidade de cookies do HOC Guard para um projeto Next.js, conforme a LGPD. Lê o código localmente (nada sai da máquina) e detecta os rastreadores (Google Analytics, GTM, Meta Pixel, Hotjar, Clarity e outros). Se houver rastreador não essencial, devolve o banner de consentimento que carrega o banner.js antes de tudo e bloqueia cada tracker até o aceite (mode consent-gate). Se só houver cookies essenciais, devolve um aviso informativo com link para a política, sem parede de consentimento (mode notice), porque a LGPD exige transparência mas não consentimento nesse caso. Informe project_path com a raiz do projeto, ou files com o conteúdo quando o código ainda não está salvo. Não altera arquivos: aplique as mudanças devolvidas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
banner_idNo
project_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.0

TDQS

A4.1/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond annotations: it states nothing leaves the machine, that it does not alter files and that returned changes must be applied by the caller (consistent with readOnlyHint/idempotentHint), lists the specific trackers detected, and describes both output modes. This is rich, actionable behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is fairly long but front-loads purpose, then mode logic, then parameter guidance, and every sentence carries information about behavior or invocation. Slightly verbose but no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and 0% parameter coverage, the description compensates by describing what is returned in each mode and how to invoke it. The only gap is the unexplained banner_id parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must carry parameter meaning. It does explain project_path (project root) and files (code not yet saved), which is useful, but never mentions banner_id, leaving one of three parameters undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: it generates cookie-consent compliance output for a Next.js project under LGPD, locally scanning code to detect trackers. The two possible outputs (consent-gate banner vs. notice) are named explicitly, so an agent knows exactly what this returns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explains the internal decision logic between consent-gate and notice modes and tells the user to supply either project_path or files, which implies when the tool applies. However, it never distinguishes this from siblings like guard_create_banner or guard_generate_policy, so selection guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.