get_ns_vars

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...

Server Nrepl nrepl-mcp-server
Category Read
Risk class Low
Parameters 11 required

What get_ns_vars does on Nrepl

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.

ParameterTypeRequiredDescription
ns string Yes Namespace to inspect

Parameters from the server's own tool schema.

Why get_ns_vars needs a policy

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.

Questions about get_ns_vars

What does the get_ns_vars tool do? +

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.

What parameters does get_ns_vars accept? +

get_ns_vars accepts 1 parameter: ns. Required: ns. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on get_ns_vars? +

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.

What risk level is get_ns_vars? +

get_ns_vars is a Read tool with low risk. Read-only tools are generally safe to allow by default.

Can I rate-limit get_ns_vars? +

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.

How do I block get_ns_vars completely? +

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.

What MCP server provides get_ns_vars? +

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.

// LOOK UP ANOTHER 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 →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.