Lensy tools

On this page

Lensy tools

The Lensy answers by calling these tools. 58 tools in 7 groups, plus the MCP tools of the servers an admin turns on.

GroupToolsNeeds
Inspect and runtime16Viewer and admin
JVM introspection8diagnose for viewer and admin, the other 7 admin only
Logs and environment2Admin only
Database metadata3Admin only
ColdBox9Viewer and admin, only when BxLens has found a ColdBox application
Notifications3BoxLang+, admin only
Actions16Admin only, each needs your approval
MCP toolsadded by the adminAdmin: every enabled server. Viewer: built-in documentation servers only

Also on this page: Settings the agent cannot change and Adding a tool.

How to read the tables

  • LOOK reads what the console already shows. ACT changes something and waits for your Approve click.
  • The Role column says who may use a tool: viewer and admin means both console roles, admin means only the admin role.
  • A viewer is not even offered the admin tools, and the server refuses them if the model asks anyway.
  • An argument with a question mark is optional.

One gate for every call

Every call, whoever makes it, goes through one gate (the Toolbox). It does these checks in turn:

  1. The license is checked (BoxLang+). A tool that belongs to a BoxLang+ feature is refused on Free, whether it only reads or changes something. The message names the feature.
  2. The role, the read only mode and console.actions are checked.
  3. The arguments are checked against the tool.
  4. The result is stripped of secrets and cut to 12,000 characters.
  5. An ai.tool line is written to the audit log.

See the threat model.

What no tool can do

No tool takes SQL text. The database tools read metadata only. There is no tool to restart or stop the server, to take a heap dump or to read a file. appAction restarts one application (it shuts the application down and BoxLang starts it again on its next request), which is the Restart button of the Applications page.

Inspect and runtime

16 tools, viewer and admin

All 16 are LOOK tools open to both roles.

ToolWhat it doesRoleKindArguments
overviewTraffic and error numbers of this server: requests in memory and per second, how many returned a 5xx, the median, p95 and p99 time, status code classes, the slowest routes, the busiest, slowest and most failing URLs. Use it for 'how many requests did we serve' and 'what is the error rate'.viewer and adminLOOKnone
requestsList recent requests, newest first, each with id, method, URL, status, time in ms, number of SQL queries and the number of issues Lens found. Use problemsOnly to see only the failed, slow or flagged ones.viewer and adminLOOKlimit?, problemsOnly?, urlContains?
requestDetailOne request in detail: its issues (N+1 queries, slow queries, slow templates, failed HTTP calls), the slowest SQL statements, exceptions and outgoing HTTP calls. Get the id from requests.viewer and adminLOOKid
inFlightThe requests running right now, longest first, with the thread each one runs on. Use it to find a request that is stuck or slow right now.viewer and adminLOOKnone
bytecodeSessionsThe sessions of the Bytecode profiler, or the widest expressions of one session: file, line, the text of the expression, how many times it ran and how long it took. Use it after hotSpots names a function. BoxLang+.adminLOOKid, limit
hotSpotsWhere a slow request or a slow URL spent its time: the functions with the most time of their own, with their share, the file and line, and whether the time was your code, the database, an outgoing call or a lock. Give a url or the id of one request. BoxLang+.adminLOOKurl, id, range
errorsErrors grouped by cause, newest first, with counts and where they happen. Each group has a status (unresolved, resolved, ignored or regressed) and a source. Pass an id from the list to get the latest events with the stack, the breadcrumbs and the tags of one issue.viewer and adminLOOKlimit?, id?
queryStatsSQL statements across all requests, ranked: runs, failures, slow runs, average, maximum and total time. Statements have placeholders and never parameter values. Use it to find slow or failing queries.viewer and adminLOOKlimit?, sort?
executorsThe thread pools (executors) of the runtime with utilization, queue size and capacity, the runtime's own health report, and findings with concrete recommendations such as a new pool size or queue capacity. Use it to answer 'how healthy are the executors and how do I improve them'.viewer and adminLOOKonlyProblems?
tasksThe scheduled tasks and their schedulers: where each scheduler comes from (tasks.json, global, application, a-la-carte), status, schedule, last and next run, runs and failures, and why a task needs attention. Give a scheduler and a task from the list to get the run history of that one task instead (BoxLang+): median, slowest and failed runs, the errors grouped by message and the newest runs.viewer and adminLOOKscheduler, task, limit
datasourcesThe database connection pools: active, idle and waiting connections, maximum size, timeouts, and findings when a pool is saturated. No URLs and no user names.viewer and adminLOOKnone
applicationsThe applications the runtime has started: state, uptime, last access, sessions (a count), timeouts, how many schedulers, tasks, watchers and class loaders each has, and the tasks and watchers that need attention. No scope values and no paths.viewer and adminLOOKnone
watchersEvery file watcher in the runtime: name, owner (empty for a global watcher), state, paths, debounce, throttle and the number of errors in a row. The runtime keeps no event counts.viewer and adminLOOKnone
aiSetupWhat bx-ai is set up with: the profiles (provider, model, whether a key is set, the agents that use each), the providers, and each agent with its model and profile. Read only, never a key.adminLOOKnone
cachesThe caches: names, provider, object count, hits, misses, hit rate, evictions and size limits. Statistics only, never the values.viewer and adminLOOKnone
modulesThe loaded BoxLang modules with their versions, and the Lens integrations (for example ORM) with their status.viewer and adminLOOKnone
configurationThe effective BoxLang runtime configuration by area, secrets hidden. Pass filter to find a setting by name or value.viewer and adminLOOKfilter?
lensInfoFacts about Lens itself and this server: the server identity (host name, address, id), the Lens version, collect level, the license state, the Plus features that are on and the live Lens settings.viewer and adminLOOKnone
searchDocsSearch the Lens documentation and return the best matching sections with their page names. Use it for questions about what a page or setting does and how to configure Lens.viewer and adminLOOKquestion

JVM introspection

8 tools, mostly admin only

diagnose is open to the viewer role. The other 7 are admin only.

ToolWhat it doesRoleKindArguments
diagnoseA health sweep that checks threads, executors, heap and garbage collection, datasources, error rate, slow requests and running requests, and returns findings sorted by severity with the evidence and the next step. Start here for 'is the server healthy' and 'what is slow right now'. A viewer gets the parts a viewer may see.viewer and adminLOOKnone
systemJVM and host numbers: CPU, heap and non-heap memory, memory pools, garbage collectors, class loading, thread counts, disks, uptime and JVM flags. Admin only.adminLOOKnone
threadsSummaryThread counts by state (RUNNABLE, BLOCKED, WAITING, TIMED_WAITING), how many are blocked on a monitor, deadlocked threads, the largest thread pools and findings. Use it for 'do we have any blocked threads'. Admin only.adminLOOKnone
blockedThreadsThreads that are blocked or waiting on a lock, with the lock each one waits for, who holds it and the top of the stack, and deadlock detection: the threads in a deadlock with their locks and owners. Admin only.adminLOOKnone
topCpuThreadsThe threads that used the most CPU time since they started, with their pool and top frames. Call it twice a few seconds apart to see which one is burning CPU now. Admin only.adminLOOKlimit?
threadPoolsThreads grouped by pool name (the thread name without its number) with the count per state. Use it to see which pool has too many threads or is stuck. Admin only.adminLOOKnone
threadStackThe stack of one thread by name, with the locks it holds and the lock it waits for. Get names from blockedThreads, threadPools or inFlight. Admin only.adminLOOKname
gcPressureGarbage collection pressure: heap use, heap after the last collection, the share of time spent collecting and findings. Admin only.adminLOOKnone

Logs and environment

2 tools, admin only

Both are LOOK tools for the admin role.

ToolWhat it doesRoleKindArguments
logsRead the server logs. Without a file it lists the log files. With a file it returns the latest lines, optionally those that contain a text or a level. Secrets are hidden. Admin only.adminLOOKfile?, query?, lines?, level?
environmentThe environment of the runtime: Java and OS facts, JVM arguments, environment variables and system properties, with secret values hidden. Admin only.adminLOOKnone

Database metadata

3 tools, admin only

Metadata only, no SQL is run.

ToolWhat it doesRoleKindArguments
dbTablesList the tables and views of a datasource from the JDBC metadata, with an approximate row count where the driver reports one. No SQL is run. Admin only.adminLOOKdatasource, filter?
dbColumnsList the columns of one table (name, type, size, nullable) and its primary key from the JDBC metadata. No SQL is run. Admin only.adminLOOKdatasource, table
dbTestOpen a connection to a datasource, validate it and report how long that took. Admin only.adminLOOKdatasource

ColdBox

9 tools, viewer and admin, only when BxLens has found a ColdBox application

app is the application name, left out when there is only one.

These tools read names, counts, times and flags. They never read a value from rc or prc, and never the reinit password: only whether one is set.

ToolWhat it doesRoleKindArguments
coldboxAppThe ColdBox application BxLens found: version, environment, counts of handlers, routes, interceptors, modules, caches and executors, and the settings that matter for speed.viewer and adminLOOKapp?
coldboxAdviceThe findings of the ColdBox Advisor, critical first, each with the evidence and a suggestion.viewer and adminLOOKapp?
coldboxEventsWhat each ColdBox event has done since the server started: requests, errors, p50, p95, event cache hits and misses, repeated views.viewer and adminLOOKapp?, limit?
coldboxRequestOne request that ran through ColdBox: route, event, layout, view, event cache result, events, views and layouts in the order they ran with their time, and the names of the rc and prc keys.viewer and adminLOOKid
coldboxCompositionWhat the application is made of: routes, handlers, interceptors and layouts.viewer and adminLOOKapp?
coldboxModulesThe modules, slowest to activate first, with depth, chain, version and activation time, and the module names found in more than one copy on disk.viewer and adminLOOKapp?
coldboxSchedulersThe ColdBox schedulers and tasks: group, meta (secrets hidden), schedule, status, runs and failures.viewer and adminLOOKapp?
coldboxCachesThe CacheBox caches: provider, objects, hit rate, evictions. Statistics only.viewer and adminLOOKapp?
coldboxExecutorsThe executors of the ColdBox async manager: health, threads, queue, tasks.viewer and adminLOOKapp?

Notifications (BoxLang+, admin only)

3 tools: BoxLang+ and admin only

All 3 are LOOK tools. They need BoxLang+ and the admin role.

ToolWhat it doesRoleKindArguments
alertRulesThe alerts Lens can send by email, with what each one watches, its default severity and limits, and whether it is on now. Use it before you change an alert. Admin only, BoxLang+.adminLOOKnone
notificationsHow notifications are set up: on or paused, who sends the mail, the recipients, the report schedule, the alerts firing now and the last mails. Never a password. Admin only, BoxLang+.adminLOOKnone
channelsThe notification channels (Slack, Teams, Telegram, webhooks): name, type, on or off, the alerts and reports that go there, the lowest severity and the last result. Never an address, a token or a key. Admin only, BoxLang+.adminLOOKnone

Actions (each needs your approval)

16 tools: admin only, each needs your approval

All 16 are ACT tools. Each waits for the administrator to click Approve.

BoxLang+ actions

On Free, these ACT tools are refused with "This action is a BoxLang+ feature":

  • taskAction and coldboxTaskAction need taskActions.
  • cacheAction and coldboxCacheAction need cacheActions.
  • appAction needs appActions.
  • watcherAction needs watcherActions.
  • alertRuleSet, recipientSet, recipientRemove, reportSchedule, notificationsSet and channelTest need notifications.

runGc, setIntegration, changeSetting and coldboxReinit work on Free.

ToolWhat it doesRoleKindArguments
taskActionCHANGES THE SERVER. Run now, pause, resume or reload a scheduled task. The administrator must approve it first. Use it only when the person asked for it.adminACTscheduler, task?, action
cacheActionCHANGES THE SERVER. Evict one key, reap expired objects or clear a whole cache. The administrator must approve it first. Use it only when the person asked for it.adminACTcache, action, key?
appActionCHANGES THE SERVER. Restart one application, which ends its sessions and stops its tasks and watchers until its next request, or remove an expired application entry. It does not restart the server. The administrator must approve it first. Use it only when the person asked for it.adminACTname, action
watcherActionCHANGES THE SERVER. Start, stop or restart one file watcher. The administrator must approve it first. Use it only when the person asked for it.adminACTname, action
runGcCHANGES THE SERVER. Run a garbage collection now. It can pause the application for a moment. The administrator must approve it first.adminACTnone
setIntegrationCHANGES THE SERVER. Turn a Lens integration (for example orm) on or off. The administrator must approve it first.adminACTid, enabled
alertRuleSetCHANGES THE SERVER. Switch one email alert on or off, or change its severity, limits or repeat time. The administrator must approve it first.adminACTrule, enabled?, severity?, limits?, repeatMinutes?
recipientSetCHANGES THE SERVER. Add a person who receives alert emails and reports, or change the one with that address. The approval card shows the address.adminACTemail, name?, minSeverity?, categories?, reports?, alerts?
recipientRemoveCHANGES THE SERVER. Stop sending alerts and reports to an address.adminACTemail
reportScheduleCHANGES THE SERVER. Change when the daily, weekly and monthly reports are sent.adminACTtime?, zone?, weekday?, monthDay?
notificationsSetCHANGES THE SERVER. Turn all notifications on or off, or pause them.adminACTenabled?, pauseMinutes?
channelTestCHANGES THE SERVER. Send a message marked TEST to one existing notification channel. It cannot create or change a channel or touch its address. The administrator must approve it first.adminACTchannel
coldboxTaskActionCHANGES THE SERVER. Run now, pause, resume or remove one ColdBox task. The administrator must approve it first. Use it only when the person asked for it.adminACTapp?, scheduler, task, action
coldboxCacheActionCHANGES THE SERVER. Clear the ColdBox event cache or view cache, or evict, reap or clear one CacheBox cache. The administrator must approve it first. Use it only when the person asked for it.adminACTapp?, action, cache?, key?
coldboxReinitCHANGES THE SERVER. Reinitialize a ColdBox application. Only when it has no reinit password: with one, the person uses the Reinit button of the bar, because the password never passes through BxLens or the model. The administrator must approve it first.adminACTapp?
changeSettingCHANGES THE SERVER. Change one live Lens setting, for example thresholds.slowQueryMs. Settings about AI, access, the console and the disk store cannot be changed. The administrator must approve it first.adminACTkey, value

diagnose is open to the viewer role, but a viewer gets only the parts of the sweep a viewer may see (executors, datasources, error rate, slow and running requests) and the answer says what was left out.

MCP tools

Added by the admin

Tools of the MCP servers the admin turned on are added to the list above. They are not in the catalog: they are found on each server (tools/list, 10 seconds, kept for 5 minutes) and filtered by the list the admin ticked.

ItemRule
Nameserver.tool for people (chips, approvals, audit), server__tool for the model. A character in a tool name other than a letter, digit, underscore or hyphen becomes _, and a name is cut to 64 characters.
Description[Server name] description, cut to 500 characters.
ArgumentsThe schema the server published, reduced to properties with a simple type (text, number, whole number, true or false), a short description and the required names. Anything else is dropped. The call is checked against it: required arguments, types, 2000 characters at most, no control characters, names the schema does not have are dropped.
RoleAdmin: every enabled server. Viewer: only the built-in documentation servers.
ApprovalBuilt-in servers: none (except sendFeedback). Custom servers: your click every time, unless the server is marked trusted, read only. A call that needs a click is refused when console.readOnly is on, or console.actions or ai.actions is off.
GateThe same Toolbox as every other tool: BoxLang+, role, enabled and ticked, arguments, tool calls per answer (ai.maxToolCalls), 120 calls a minute, redaction and the 12,000 character cap. The result is wrapped with a reminder that it is data from outside.
Auditai.mcp server=... tool=... result=ok|denied|error ms=...

Settings the agent cannot change

changeSetting can change a live Lens setting, for example thresholds.slowQueryMs.

Never changed by the agent, even when you approve
  • ai.* (a changed address or key would send your data elsewhere)
  • console.*
  • access.*
  • bar.access
  • store.*

Adding a tool

A new tool goes through the Toolbox, is audited and role checked. Add it in three places and a test checks that they agree:

  1. The method with @AITool in models/ops/LensyTools.bx (its comment is what the model reads).
  2. The entry in ops/Tools.java (name, role, kind, arguments).
  3. A row in this table.

An ACT tool must also be admin only and needs an approval.

Edit this page Download Markdown Last updated Nov 26, 2026, 8:34:30 AM Report an issue