Skip to content

let agents refresh a custom MCP server's tools, and refresh them when stale - #380

Merged
hkonsti merged 1 commit into
mainfrom
hkonsti/mcp-tool-list-refresh
Nov 23, 2026
Merged

hkonsti merged 1 commit into
mainfrom
hkonsti/mcp-tool-list-refresh

Conversation

@hkonsti

@hkonsti hkonsti commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Agents can now ask a custom MCP server for its tools again with pap.refreshTools(connection) (pap tools <connection> --refresh in a sandbox), as the connection page's button does. It needs an open task and a connection the agent can use. It answers with the tools the agent has and the names of those the person hasn't turned on, so an agent can say which tool to allow instead of guessing.

The list is also refreshed automatically: when an agent reads it and it is over an hour old, and, at most once a minute, when a call names a tool the list lacks or one the server says it no longer has. In that last case the agent gets "No tool X" instead of the server's error. Before this, a server that removed or added tools left agents calling dead tools until the person clicked refresh.

Refresh times are kept in memory per instance (no migration), concurrent refreshes of one connection share a request, and a refresh that fails leaves the saved list in use. New tools stay off until the person turns them on, and settings for tools the server no longer lists are dropped, as with the button. updateConnectionTools now only writes while the connection is still a custom MCP one, so a refresh racing a move to a built-in integration can't delete that integration's settings.


Open workspace in Conductor

…emselves when the list is stale

pap.refreshTools(connection), and `pap tools <connection> --refresh` from a
sandbox, asks a custom MCP server for its tools now and keeps the new list, as
the connection page's button does, for an open task on a connection the agent
can use. It answers with the tools the agent has and the names of the ones the
person hasn't turned on, so an agent can say which to allow.

The list is also asked for again without anyone asking: by an agent reading it
once it is an hour old, and, at most once a minute, by a call naming a tool the
list lacks or one the server says it no longer has, which is then not found
rather than failing as the server's error. Asking that fails leaves the kept
list to read. The page's button goes through the same code, and
updateConnectionTools only writes while the connection is still a custom one.
@hkonsti
hkonsti merged commit 2a1d820 into main Nov 23, 2026
4 checks passed
@hkonsti
hkonsti deleted the hkonsti/mcp-tool-list-refresh branch November 23, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant