[BUG] Agent tool accepts invalid subagent_type without validation error

Resolved 💬 4 comments Opened Mar 10, 2026 by maisy-capps Closed Apr 8, 2026

Description

When the Agent tool is called with an unrecognized subagent_type value — for
example, a plugin skill name instead of a registered agent type — the tool fails
without a clear, actionable error message. There is no validation that tells the model
which subagent_type values are valid.

Steps to Reproduce

  1. Install a Claude Code plugin that contains both skills and agents.
  2. Invoke a skill via the Skill tool to load its instructions.
  3. The model, following the loaded skill instructions, passes the skill name as

subagent_type to the Agent tool:
\\\json
{ "subagent_type": "my-plugin:some-skill", ... }
\
\\

  1. The call fails — but without an error that names which subagent_type values are

actually registered.

Expected Behavior

The Agent tool should validate subagent_type at call time and, on an unrecognized
value, return a clear error listing valid agent types, e.g.:

Unknown subagent_type "my-plugin:some-skill". Registered agents for this plugin are: my-plugin:agent-one, my-plugin:agent-two.

Actual Behavior

The call fails ambiguously. The model has no signal to self-correct, and the user has
to diagnose why the agent wasn't invoked.

Why It Matters

Skills and agents are structurally different: skills are loaded inline via the Skill
tool; agents are subprocesses invoked via the Agent tool. A model that just loaded a
skill has its name in context and can reasonably but incorrectly pass it as
subagent_type. Validation at the tool boundary would make this mistake self-correcting
without requiring documentation workarounds.

Environment

  • Claude Code version: latest
  • Plugin: custom plugin with mixed skills and agents

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗