Skip to content

Commit a7a90c9

Browse files
Copilotfuxingloh
andauthored
fix(USE-71): make --uri optional on parent tools command to allow tools call to work
Agent-Logs-Url: https://github.com/AgentlyHQ/use-agently/sessions/a276eaea-d933-4f61-846c-92fe66f97ecf Co-authored-by: fuxingloh <[email protected]>
1 parent 29ffd42 commit a7a90c9

File tree

1 file changed

+8
-5
lines changed
  • packages/use-agently/src/commands

1 file changed

+8
-5
lines changed

packages/use-agently/src/commands/tools.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ function checkSpendLimit(err: DryRunPaymentRequired, maxSpendPerCall: number): v
3939
}
4040

4141
export const toolsCommand = new Command("tools")
42-
.description("List available tools on an MCP server")
43-
.requiredOption("-u, --uri <value>", "MCP server URL or CAIP-19 ID")
44-
.showHelpAfterError(true)
42+
.description("List or call tools on an MCP server")
43+
.option("-u, --uri <value>", "MCP server URL or CAIP-19 ID")
4544
.addHelpText(
4645
"after",
47-
"\nExamples:\n use-agently tools --uri https://example.com/mcp\n use-agently tools --uri eip155:8453/erc8004:0x1234/1",
46+
"\nExamples:\n use-agently tools --uri https://example.com/mcp\n use-agently tools --uri eip155:8453/erc8004:0x1234/1\n use-agently tools call --uri https://example.com/mcp --tool echo",
4847
)
49-
.action(async (options: { uri: string }, command: Command) => {
48+
.action(async (options: { uri?: string }, command: Command) => {
49+
if (!options.uri) {
50+
command.outputHelp();
51+
return;
52+
}
5053
const tools = await listMcpTools(defaultClient, options.uri, {
5154
clientInfo: { name: "use-agently", version: pkg.version },
5255
fetchImpl: clientFetch,

0 commit comments

Comments
 (0)