Get all public vars (functions, values) in a namespace with their metadata and current values. Example: - List main namespace vars: (get_ns_vars {:ns "main"}) Returns a map where keys are var names and values contain: - :meta - Metadata including :doc string, :line number, :file path - :value - C...
AI agents call get_ns_vars to retrieve information from Nrepl without modifying anything — typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
ns | string | Yes | Namespace to inspect |
Parameters from the server's own tool schema.
This tool performs introspection on a Clojure namespace, returning metadata and values without creating, modifying, deleting, or executing arbitrary code. It is a pure read operation that queries the current state of the runtime. The sibling tool 'eval_form' would be Execute (code evaluation), but this tool specifically retrieves existing definitions without evaluation or modification.
From the tool's definition Tool retrieves and lists public vars (functions, values) in a namespace with their metadata and current values. The description uses "Get all public vars" and "Returns a map" indicating data retrieval with no modification.
Attacks that exploit this kind of access
Get all public vars (functions, values) in a namespace with their metadata and current values. Example: - List main namespace vars: (get_ns_vars {:ns "main"}) Returns a map where keys are var names and values contain: - :meta - Metadata including :doc string, :line number, :file path - :value - Current value of the var. It is categorised as a Read tool in the Nrepl MCP Server, which means it retrieves data without modifying state.
get_ns_vars accepts 1 parameter: ns. Required: ns. The full parameter table on this page comes from the server's own tool schema.
Register the Nrepl MCP server in PolicyLayer and add a rule for get_ns_vars: 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 Nrepl. Nothing to install.
get_ns_vars 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_ns_vars 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_ns_vars. 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_ns_vars is provided by the Nrepl MCP server (nrepl-mcp-server). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Every MCP server has a record like this.
Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.
Teams ship this data inside their own products. See what a licence covers →