Skip to content

feat (coding-agent): Expose getToolDefinition to command context#4954

Closed
xl0 wants to merge 2 commits into
earendil-works:mainfrom
xl0:cmd-tool-defs
Closed

feat (coding-agent): Expose getToolDefinition to command context#4954
xl0 wants to merge 2 commits into
earendil-works:mainfrom
xl0:cmd-tool-defs

Conversation

@xl0
Copy link
Copy Markdown
Contributor

@xl0 xl0 commented May 24, 2026

I've seen more than enough tools and mcp servers where the author clearly never reviewed the actual output of those tools.

I made a /tool command extension that lets you call the agent tools manually. It does not add the calls to the context, just adds a nice ui to fill in the input schema and displays the tool output mostly raw - no custom rendering.

Peek.2026-05-24.12-30.mp4

Right now we actually don't have a way to grab the tool definitions from a command context. We have getAllTools that resurns ToolInfo[]:

export type ToolInfo = Pick<ToolDefinition, "name" | "description" | "parameters"> & {
	sourceInfo: SourceInfo;
};

which picks out just a few items from the ToolDefinition.

This PR just adds a getToolDefinition to the command context, which calls the AgentSession getToolDefinition and wraps the output in ReadOnly as a hint. Not married to the implementation. Maybe we could just expose the AgentSession to the commands and tools?

P.S.
Also a somewhat unrelated

export { convertToPng } from "./utils/image-convert.ts";

@xl0 xl0 changed the title Cmd tool defs feat (coding-agent): Expose getToolDefinition to command context May 24, 2026
@badlogic badlogic closed this May 28, 2026
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.

2 participants