OpenBB-finance/OpenBB · error · PromptError
Missing required arguments: {missing}
Error message
Missing required arguments: {missing} What it means
Thrown by Prompt.render (as PromptError) when a prompt declares required arguments but the caller did not supply all of them. Defaults stored in argument_defaults are applied first, then the caller's arguments; the check compares the union of both against the names of arguments flagged required=True.
Source
Thrown at openbb_platform/extensions/mcp_server/openbb_mcp_server/models/prompts.py:30
content: str
argument_defaults: dict[str, Any] = {}
async def render(
self,
arguments: dict[str, Any] | None = None,
) -> list[PromptMessage]:
"""Render the prompt with arguments."""
# Start with stored defaults, then overlay caller-supplied values
args = {**self.argument_defaults, **(arguments or {})}
# Validate required arguments
if self.arguments:
required = {arg.name for arg in self.arguments if arg.required}
provided = set(args)
missing = required - provided
if missing:
raise PromptError(f"Missing required arguments: {missing}")
try:
rendered_content = (
self.content.format(**args) if self.arguments or args else self.content
)
return [
PromptMessage(
role="user", content=TextContent(type="text", text=rendered_content)
)
]
except KeyError as e:
raise PromptError(f"Missing argument for formatting: {e}") from e
View on GitHub (pinned to 3e071fcc2c)
Solutions
- Pass every required argument by its exact declared name: prompt.render(arguments={"ticker": "AAPL"})
- Set a default in the prompt definition (argument_defaults={"ticker": "AAPL"}) or mark the argument required: False if it is genuinely optional
- Inspect prompt.arguments (name/required fields) before rendering to build the call dynamically
Example fix
# before
messages = prompt.render(arguments={"period": "1y"}) # ticker missing
# after
messages = prompt.render(arguments={"ticker": "AAPL", "period": "1y"}) Defensive patterns
Strategy: validation
Validate before calling
required = {
a.name for a in (prompt.arguments or []) if a.required
}
provided = {**prompt.argument_defaults, **(arguments or {})}
missing = required - provided.keys()
if missing:
raise ValueError(f"supply values for: {missing}")
messages = prompt.render(arguments=arguments) Type guard
def can_render(prompt, arguments: dict | None) -> bool:
required = {a.name for a in (prompt.arguments or []) if a.required}
have = {**prompt.argument_defaults, **(arguments or {})}
return required <= have.keys() Try / catch
from openbb_mcp_server.models.prompts import PromptError
try:
messages = prompt.render(arguments=args)
except PromptError as e:
if "Missing required arguments" in str(e):
args.update({name: default_for(name) for name in extract_missing(str(e))})
messages = prompt.render(arguments=args)
else:
raise Prevention
- Build the arguments dict from prompt.arguments metadata so nothing is omitted
- Give required arguments sensible argument_defaults when authoring prompts
- Match key names exactly — the check is case- and spelling-sensitive
When it happens
Trigger: A prompt declares arguments=[{name: "ticker", required: True}] and the client calls render(arguments={}) or only passes another optional argument. Also when the argument key is misspelled ("ticke") so the required "ticker" is still missing.
Common situations: MCP clients omitting optional-looking parameters, schema drift after a prompt gains a new required argument, spelling/case mismatches between client-supplied keys and declared argument names (matching is exact, not case-insensitive).
Related errors
- Duplicate prompt names found: {set(duplicates)}
- Category '{category}' not found. Available categories: {', '
- Subcategory '{subcategory}' not found in category '{category
- The 'files' dict must include a 'SKILL.md' entry as the main
- Prompt content cannot be empty
AI-assisted analysis of OpenBB-finance/OpenBB@3e071fcc2c (2026-08-14).
Data as JSON: /api/errors/74f96e170334ff49.
Report an issue: GitHub.