Skip to content

Improve mcp list-tools output style with table rendering and allow status column - #1087

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-2a483a0e-e1d2-4b1e-9137-03cfc3815309
Sep 28, 2025
Merged

pelikhan merged 6 commits into
mainfrom
copilot/fix-2a483a0e-e1d2-4b1e-9137-03cfc3815309

Conversation

Copilot AI commented Sep 28, 2025 •

Copy link
Copy Markdown
Contributor

Fixes the output formatting of the mcp list-tools command to use professional table rendering instead of numbered lists, with proper description truncation for better readability. Also adds tool allowance status indicators showing workflow configuration.

Problem

The original mcp list-tools command used a numbered list format that could result in very long, hard-to-read lines:

1. add_comment_to_pending_review - Add review comment to the requester's latest pending pull request review. A pending review needs to already exist to call this (check with the user if not sure).
2. add_issue_comment - Add a comment to a specific issue in a GitHub repository.
3. assign_copilot_to_issue - Assign Copilot to a specific issue in a GitHub repository.

This format was inconsistent with modern CLI tools and made it difficult to quickly scan tool names, descriptions, and allowance status.

Solution

Non-verbose mode now uses a clean table format with allow status and truncated descriptions:

ℹ 🛠️  Available Tools (3 total)
Tool Name                   | Allow | Description                                                 
--------------------------- | ----- | ------------------------------------------------------------
add_comment_to_pending_review | ✅     | Add review comment to the requester's latest pending pull...
add_issue_comment           | ✅     | Add a comment to a specific issue in a GitHub repository.  
assign_copilot_to_issue     | 🚫     | Assign Copilot to a specific issue in a GitHub repository. 

Run with --verbose for detailed information

Verbose mode shows detailed information with allow/deny status and full descriptions:

ℹ 🛠️  Available Tools (3 total)
Tool Name                   | Allow | Description                                                                                     
--------------------------- | ----- | ------------------------------------------------------------------------------------------------
add_comment_to_pending_review | ✅     | Add review comment to the requester's latest pending pull request review. A pending review needs to already exist to call this (check with the user if not sure).
add_issue_comment           | ✅     | Add a comment to a specific issue in a GitHub repository.                                       
assign_copilot_to_issue     | 🚫     | Assign Copilot to a specific issue in a GitHub repository.                                     

📊 Summary: 2 allowed, 1 not allowed out of 3 total tools

Workflow configuration wildcard allows all tools to be enabled:

tools:
  github:
    allowed: ["*"]  # All tools will show ✅

Key Improvements

  • Professional table layout: Uses the existing console.RenderTable functionality for consistent formatting
  • Allow status column: Shows ✅ for allowed tools and 🚫 for denied tools in both verbose and non-verbose modes based on workflow configuration
  • Single-line per tool: Non-verbose mode limits descriptions to 60 characters with "..." truncation
  • Full descriptions in verbose mode: Fixed bug where verbose mode was incorrectly truncating descriptions
  • Workflow configuration display: Allow status reflects exactly what is configured in the workflow
  • Wildcard support: Workflow configuration supports "*" wildcard to allow all tools
  • Better readability: Clean columns make it easy to scan tool names, status, and descriptions
  • Backwards compatibility: All existing functionality, arguments, and edge cases preserved

Testing

Added comprehensive unit tests covering:

  • Non-verbose table formatting with allow status and truncation
  • Verbose mode with full descriptions and allow/deny status
  • Empty tool lists
  • Tools with no restrictions (all allowed)
  • Wildcard support in workflow configuration

All existing tests continue to pass, ensuring no regressions.

Original prompt

Improve the output style of the "mcp list-tools" command:

  • use console table rendering for the list of tools
  • limit the description such that each tool stays on a single line (full description in --verbose mode)

Here is a sample run:

@pelikhan ➜ /workspaces/gh-aw (main) $ ./gh-aw mcp list-tools github tidy
ℹ 📡 Connecting to MCP server: github (docker)

ℹ 🛠️  Available Tools (90 total)
1. add_comment_to_pending_review - Add review comment to the requester's latest pending pull request review. A pending review needs to already exist to call this (check with the user if not sure).
2. add_issue_comment - Add a comment to a specific issue in a GitHub repository.
3. add_sub_issue - Add a sub-issue to a parent issue in a GitHub repository.
4. assign_copilot_to_issue - Assign Copilot to a specific issue in a GitHub repository.

This tool can help with the following outcomes:
- a Pull Request created with source code changes to resolve the issue


More information can be found at:
- https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot

5. cancel_workflow_run - Cancel a workflow run
6. create_and_submit_pull_request_review - Create and submit a review for a pull request without review comments.
7. create_branch - Create a new branch in a GitHub repository
8. create_gist - Create a new gist
9. create_issue - Create a new issue in a GitHub repository.
10. create_or_update_file - Create or update a single file in a GitHub repository. If updating, you must provide the SHA of the file you want to update. Use this tool to create or update a file in a GitHub repository remotely; do not use it for local file operations.
11. create_pending_pull_request_review - Create a pending review for a pull request. Call this first before attempting to add comments to a pending review, and ultimately submitting it. A pending pull request review means a pull request review, it is pending because you create it first and submit it later, and the PR author will not see it until it is submitted.
12. create_pull_request - Create a new pull request in a GitHub repository.
13. create_repository - Create a new GitHub repository in your account or specified organization
14. delete_file - Delete a file from a GitHub repository
15. delete_pending_pull_request_review - Delete the requester's latest pending pull request review. Use this after the user decides not to submit a pending review, if you don't know if they already created one then check first.
16. delete_workflow_run_logs - Delete logs for a workflow run
17. dismiss_notification - Dismiss a notification by marking it as read or done
18. download_workflow_run_artifact - Get download URL for a workflow run artifact
19. fork_repository - Fork a GitHub repository to your account or specified organization
20. get_code_scanning_alert - Get details of a specific code scanning alert in a GitHub repository.
21. get_commit - Get details for a commit from a GitHub repository
22. get_dependabot_alert - Get details of a specific dependabot alert in a GitHub repository.
23. get_discussion - Get a specific discussion by ID
24. get_discussion_comments - Get comments from a discussion
25. get_file_contents - Get the contents of a file or directory from a GitHub repository
26. get_global_security_advisory - Get a global security advisory
27. get_issue - Get details of a specific issue in a GitHub repository.
28. get_issue_comments - Get comments for a specific issue in a GitHub repository.
29. get_job_logs - Download logs for a specific workflow job or efficiently get all failed job logs for a workflow run
30. get_latest_release - Get the latest release in a GitHub repository
31. get_me - Get details of the authenticated GitHub user. Use this when a request is about the user's own profile for GitHub. Or when information is missing to build other tool calls.
32. get_notification_details - Get detailed information for a specific GitHub notification, always call this tool when the user asks for details about a specific notification, if you don't know the ID list notifications first.
33. get_pull_request - Get details of a specific pull request in a GitHub repository.
34. get_pull_request_comments - Get comments for a specific pull request.
35. get_pull_request_diff - Get the diff of a pull request.
36. get_pull_request_files - Get the files changed in a specific pull request.
37. get_pull_request_reviews - Get reviews for a specific pull request.
38. get_pull_request_status - Get the status of a specific pull request.
39. get_release_by_tag - Get a specific release by its tag name in a GitHub repository
40. get_secret_scanning_alert - Get details of a specific secret scanning alert in a GitHub repository.
41. get_tag - Get details about a specific git tag in a GitHub repository
42. get_team_members - Get member usernames of a specific team in an organization. Limited to organizations accessible with current ...

</details>
Created from VS Code via the [GitHub Pull Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • for each tool, show allowed state in a new column (before description). Use emojis.

  • add --allowed flag that configures the MCP server with the list of allowed tools as with the agent

Copilot AI changed the title Improve the output style of the "mcp list-tools" command: - use console table rendering for the list of tools - limit the description such that each tool stays on a single line (full description in --verbose mode) Here is a sample run: ``` @pelikhan... Improve mcp list-tools output style with table rendering and description truncation Sep 28, 2025
Copilot AI requested a review from pelikhan September 28, 2025 11:03

Copilot AI commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

@copilot

  • for each tool, show allowed state in a new column (before description). Use emojis....

Both features have been implemented in commit 68cd3ff:

  1. Allow column with emojis: Added "Allow" column to non-verbose mode showing ✅ for allowed tools and 🚫 for denied tools, positioned before the description column as requested.

  2. --allowed flag: Added -a, --allowed flag that accepts a comma-separated list of tools to override the workflow configuration.

Before:

Tool Name | Description                                                 
--------- | ------------------------------------------------------------
tool1     | This is a short description                                 
tool2     | This is a very long description that exceeds the maximum ...

After:

Tool Name | Allow | Description                                                 
--------- | ----- | ------------------------------------------------------------
tool1     | ✅     | This is a short description                                 
tool2     | 🚫     | This is a very long description that exceeds the maximum ...

--allowed flag usage:

gh aw mcp list-tools github workflow --allowed tool1,tool3
# Only tool1 and tool3 will show ✅, others show 🚫

The flag overrides workflow configuration and works in both verbose and non-verbose modes.

Copilot AI changed the title Improve mcp list-tools output style with table rendering and description truncation Improve mcp list-tools output style with table rendering, allow status column, and --allowed flag Sep 28, 2025
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • --allowed uses the list of allowed tools configured in the workflow
  • make sure to handle wildcard allowed ("*")

Copilot AI commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

@copilot

  • --allowed uses the list of allowed tools configured in the workflow...

Both requirements have been implemented in commit eedd532:

  1. --allowed uses the list of allowed tools configured in the workflow: The --allowed flag maintains the same behavior as workflow configuration, including wildcard support and proper override semantics.

  2. Handle wildcard allowed ("*"): Added comprehensive wildcard support:

    • --allowed "*" allows all tools (shows all ✅)
    • Workflow config with "allowed": ["*"] allows all tools
    • Works in both verbose and non-verbose modes

Examples:

Command-line wildcard:

gh aw mcp list-tools github workflow --allowed "*"
# All tools show ✅

Workflow config wildcard:

tools:
  github:
    allowed: ["*"]

Test output showing wildcard working:

ℹ 🛠️  Available Tools (3 total)
Tool Name | Allow | Description                                                 
--------- | ----- | ------------------------------------------------------------
tool1     | ✅     | This is a short description                                 
tool2     | ✅     | This is a very long description that exceeds the maximum ...
tool3     | ✅     | Another tool with a medium-length description               

The wildcard "*" is now properly handled as a special case meaning "all tools are allowed" in both workflow configuration and the --allowed flag.

Copilot AI changed the title Improve mcp list-tools output style with table rendering, allow status column, and --allowed flag Improve mcp list-tools output style with table rendering, allow status column, --allowed flag, and wildcard support Sep 28, 2025
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • remove the --allowed flag
  • show allowed state from configuration data

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot continue plan

Copilot AI commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

@copilot continue plan

Plan completed in commit 917fdc6:

  1. --allowed flag removed: Completely removed the command-line --allowed flag and all related functionality.

  2. Show allowed state from configuration data: The Allow column now displays status based purely on workflow configuration data.

Current behavior:

  • Allow column shows ✅/🚫 based on workflow's allowed list only
  • Wildcard "*" in workflow config still works (shows all tools as ✅)
  • No command-line overrides - clean, simple interface
  • Table format retained with professional styling

Help output now clean:

Flags:
  -h, --help      help for list-tools
  -v, --verbose   Enable verbose output with detailed tool information

Sample output:

ℹ 🛠️  Available Tools (3 total)
Tool Name | Allow | Description                                                 
--------- | ----- | ------------------------------------------------------------
tool1     | ✅     | This is a short description                                 
tool2     | 🚫     | This is a very long description that exceeds the maximum ...
tool3     | ✅     | Another tool with a medium-length description               

The tool now shows exactly what the workflow configuration specifies without any command-line complexity.

Copilot AI changed the title Improve mcp list-tools output style with table rendering, allow status column, --allowed flag, and wildcard support Improve mcp list-tools output style with table rendering and allow status column Sep 28, 2025
@pelikhan
pelikhan marked this pull request as ready for review September 28, 2025 17:41
@pelikhan
pelikhan merged commit 501dd88 into main Sep 28, 2025
@pelikhan
pelikhan deleted the copilot/fix-2a483a0e-e1d2-4b1e-9137-03cfc3815309 branch September 28, 2025 17:42
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