Skip to content

[BUG] Azure CLI - print docs and exit with 1? #1102

@diberry

Description

@diberry

Describe the bug

If I'm asking for the help instructions tools list --help why is the exit code 1. It is successfully doing what I asked it to do.

Expected behavior

Exit code 0 (no errors)

Actual behavior

dotnet run --no-build -- tools list --help
EXIT_CODE=$?
echo "Exit code: $EXIT_CODE"
Description:
List all available commands and their tools in a hierarchical structure. This command returns
detailed information
about each command, including its name, description, full command path, available subcommands, and
all supported
arguments. Use this to explore the CLI's functionality or to build interactive command interfaces.

Usage:
azmcp tools list [options]

Options:
--namespaces If specified, returns a list of top-level service namespaces instead of individual
tools.
-?, -h, --help Show help and usage information

Exit code: 1

Reproduction Steps

mcp/servers/Azure.Mcp.Server/src> dotnet run --no-build -- tools list --help

exit code 1

Environment

windows host with devcontainer

Metadata

Metadata

Assignees

Labels

server-Azure.McpAzure.Mcp.Servertools-CoreAZMCP Core functionality that all other tools build on top of

Type

No type

Projects

Status

Not Started

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions