Skip to content

server : validate --tools CLI argument against known tool names#22538

Merged
ggerganov merged 1 commit into
masterfrom
gg/server-sanitize-tools-cli-arg
May 5, 2026
Merged

server : validate --tools CLI argument against known tool names#22538
ggerganov merged 1 commit into
masterfrom
gg/server-sanitize-tools-cli-arg

Conversation

@ggerganov

Copy link
Copy Markdown
Member

Overview

The --tools CLI argument currently silently ignores unknown tool names. This PR adds validation so that unrecognized tool names cause the server to exit with a clear error message listing the available tools.

Before: llama-server --tools read_file,typo_tool would silently start with only read_file enabled.

After: The server exits with:

error: tools setup failed: unknown tool "typo_tool". available tools: read_file, file_glob_search, grep_search, exec_shell_command, write_file, edit_file, apply_diff

Additional information

Changes:

  • server-tools.cpp: validate each tool name in server_tools::setup() against the known tools from build_tools(), throwing std::runtime_error for unknown names
  • server.cpp: wrap tools.setup() in try-catch to report the error cleanly and exit

Requirements

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
@ggerganov ggerganov marked this pull request as ready for review May 4, 2026 17:23
@ggerganov ggerganov requested a review from a team as a code owner May 4, 2026 17:23
@ggerganov ggerganov merged commit 2bacb1e into master May 5, 2026
46 checks passed
@ggerganov ggerganov deleted the gg/server-sanitize-tools-cli-arg branch May 5, 2026 03:35
samuraieng pushed a commit to samuraieng/llama.cpp that referenced this pull request May 6, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
cetarthoriphros pushed a commit to cetarthoriphros/llama.cpp that referenced this pull request May 9, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
meh pushed a commit to meh/llama.cpp that referenced this pull request May 10, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
baramofme pushed a commit to baramofme/llama-cpp-turboquant that referenced this pull request May 23, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
carlosfundora pushed a commit to carlosfundora/llama.cpp-1-bit-turbo that referenced this pull request May 24, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
(cherry picked from commit 2bacb1e)
winstonma pushed a commit to winstonma/llama.cpp that referenced this pull request May 27, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
…-org#22538)

Previously, unknown tool names passed via --tools were silently ignored.
Now the server validates each tool name at startup and exits with an
error if an unrecognized tool is specified, listing the available tools.

Assisted-by: llama.cpp:local pi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants