Skip to content

Show inline parameter signatures in tools list#82

Merged
jancurn merged 11 commits into
mainfrom
claude/show-tool-parameters-5loH1
Mar 17, 2026
Merged

Show inline parameter signatures in tools list#82
jancurn merged 11 commits into
mainfrom
claude/show-tool-parameters-5loH1

Conversation

@jancurn

@jancurn jancurn commented Mar 17, 2026

Copy link
Copy Markdown
Member

Summary

Enhanced the tools-list command to display inline parameter signatures with abbreviated type names, allowing users to quickly scan tool parameters without needing the --full flag.

Plus adds other interface improvements, e.g. rename --async to --task

Key Changes

  • New shortType() function: Converts JSON Schema types to compact abbreviations (e.g., stringstr, array<number>[num], union types → type1 | type2)
  • New formatToolParamsInline() function: Generates inline parameter signatures showing up to 3 parameters (required first, then optional) with ellipsis () for additional parameters
  • Updated tool summary formatting: Tool names now display with inline parameters in backticks (e.g., `search_web(query: str, maxResults?: num, language?: str)`)
  • Comprehensive test coverage: Added 40+ test cases covering primitive types, arrays, nested arrays, union types, enums, and edge cases

Implementation Details

  • Parameters are ordered with required parameters first (in declaration order), followed by optional parameters
  • Maximum of 3 parameters are shown inline; additional parameters are indicated with an ellipsis
  • Type abbreviations: str, num, int, bool, obj, [type] for arrays, enum for enums
  • Union types filter out null and display remaining types separated by |
  • Gracefully handles missing or invalid schema information by defaulting to any

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH

claude and others added 11 commits March 17, 2026 00:38
Display required parameters and collapsed optional count in the compact
tools-list view, so users can see at a glance what each tool expects
without needing --full.

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
Types are now abbreviated (str, num, obj, bool, [str]) for conciseness.
At most 3 parameters are shown inline, with required params first,
then optional in declaration order. Remaining params are indicated
with "…".

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
Backticks now enclose the tool name and params together, e.g.
`ping()` instead of `ping`(). Also exports shortType and adds
unit tests for the abbreviated type formatting.

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
Distinguishes integer parameters from number (float) parameters
in the compact tool listing.

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
- Fix TS2345 by defaulting undefined properties to {}
- Export formatToolParamsInline and add unit tests for empty,
  ordering, and truncation behavior
- Apply Prettier formatting

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
…x e2e

- Remove chalk.dim from parameter list so it renders in normal color
- Export and add unit tests for formatToolParamsInline
- Fix e2e human-output test to match new backtick-wrapping format

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
Remove the separate "Task support:" section from tools-get detail
view and instead show the task mode inline as [task:optional],
[task:required], or [task:forbidden] in both tools-list and
tools-get annotations.

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
The MCP spec uses "task" terminology (taskSupport, taskId, etc.),
so the CLI flag should match. --detach now implies --task instead
of --async. Updated all source, tests, and changelog references.

https://claude.ai/code/session_01CzLbKsRtTusJ1ypzKwKkaH
@jancurn jancurn merged commit fc626e6 into main Mar 17, 2026
6 checks passed
@jancurn jancurn deleted the claude/show-tool-parameters-5loH1 branch April 7, 2026 22:27
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.

3 participants