Skip to content

--available-tools with an empty value exposes all tools instead of none #5306

Open

Description

@MorganShowman

Describe the bug

--available-tools is documented to disable every tool not listed, but an empty value (--available-tools= or --available-tools '') sends all 21 built-in tools, the same as omitting the flag. There's no documented way to run copilot -p with no tools.

Flag Tools sent to the model
--available-tools= 21
--available-tools '' 21
--excluded-tools '*' 21
--available-tools __none__ (a name that matches no tool) 0

The workaround in the last row works, but it relies on unknown tool names being silently ignored.

Affected version

GitHub Copilot CLI 1.0.105

Steps to reproduce the behavior

  1. In an empty directory, run:
    copilot -p "Reply with the word ok." -s --model claude-haiku-5.5 \
      --available-tools= --disable-builtin-mcps --no-custom-instructions --no-ask-user
    
  2. Read the tool count from the newest session's events:
    EVENTS=$(ls -t ~/.copilot/session-state/*/events.jsonl | head -1)
    jq -rn 'first(inputs | select(.type == "session.usage_checkpoint"))
      | .data.promptCacheBreakState[0].models[]
      | "\(.model): tool_count=\(.tool_count) tool_tokens=\(.tool_tokens)"' "$EVENTS"
    
    Output: claude-haiku-5.5: tool_count=21 tool_tokens=10439
  3. Repeat steps 1 and 2 with --available-tools __none__.
    copilot -p "Reply with the word ok." -s --model claude-haiku-5.5 \
      --available-tools='__none__' --disable-builtin-mcps --no-custom-instructions --no-ask-user
    
    Output: claude-haiku-5.5: tool_count=0 tool_tokens=0

Expected behavior

An empty --available-tools exposes no tools, or there's a documented way to disable all tools and an empty value is rejected with an error.

Additional context

For text-only copilot -p calls in CI, the unwanted tool definitions add about 10,000 tokens per call. Related: #4596 (system prompt still references removed tools), #407 (list available tools).

Activity

  1. added
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automationarea:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions