Skip to main content
Glama
Firenook

Firenook

Official

rules_evaluate

Read-onlyIdempotent

Evaluate a Firestore or Storage request against security rules to get the allow/deny verdict, deciding rule line, and expression values without writing data.

Instructions

Ask the rules in force (or a draft) whether a request would be allowed: get, list, create, update or delete on a Firestore path or Storage object as a given user or unauthenticated; returns the verdict, the rule line that decided it and each evaluated expression's value. Nothing is written.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "method": "<method>",
      "path": "<path>"
    },
    "name": "rules_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
uidNoAct as this signed-in user; omit for an unauthenticated request
dataNoFirestore create/update: the written fields as plain JSON (update: the fields set over the existing document)
pathYesFirestore document path (a collection path for list), or the Storage object name (a folder ending in / for list)
timeNorequest.time as RFC 3339; default now
limitNoFirestore list: the query limit
whereNoFilters combined with AND
bucketNoStorage bucket; default the default bucket
claimsNorequest.auth.token: custom claims and token fields (email, firebase.sign_in_provider...)
methodYesThe operation
objectNoStorage create/update: the proposed object
sourceNoEvaluate this draft rules source instead of the rules in force
idTokenNoAct as the user of this emulator ID token (from auth_mint_token) instead of uid/claims
orderByNoSort keys
serviceNoWhich rules: firestore (default) or storage
databaseNoFirestore database id; default (default)
existingNoFirestore: the document before the request as plain JSON, or null for none; default the stored document
collectionGroupNoFirestore list: a collection-group query on the path's last collection id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and the description corroborates and humanizes this with 'Nothing is written.' It adds genuine context beyond the annotations by disclosing what comes back (verdict, deciding rule line, every evaluated expression's value) in the absence of an output schema, plus the in-force-vs-draft mode of operation.

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?

It is a single dense sentence with an embedded colon list that front-loads the core purpose and ends with the return contract and the no-write guarantee. Every clause carries information, though the run-on structure and semicolon chaining make it slightly harder to scan than it could be.

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?

For a 17-parameter simulation tool with nested objects and no output schema, the description covers the essential unknowns: what is evaluated, in which mode (in force or draft), against which service, as which principal, and what the response contains. Remaining details such as defaults for database/bucket/time are adequately handled by the schema.

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 100%, so all 17 parameters, including nested where/orderBy/object/claims structures, are self-documenting. The description adds only marginal meaning, mainly clarifying that 'uid' means act as that user and that 'source' means evaluate a draft instead of the rules in force — helpful but largely restating what the schema already conveys.

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?

The description names a precise operation (ask the rules whether a request would be allowed), enumerates the method space (get/list/create/update/delete), the resource space (Firestore path or Storage object), and the actor (given user or unauthenticated). It also promises the return content (verdict, deciding rule line, evaluated expression values), which makes it unmistakably distinct from the sibling rules_get, which fetches rules text rather than verdicts.

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

Usage Guidelines4/5

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

Usage is clearly framed: use this to test whether a request would be permitted, either against the rules in force or against a draft supplied via source. It does not name the alternative explicitly (e.g. rules_get for retrieving source, rules_list_denials for finding failures) or state exclusions, so it falls short of the top tier.

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