Common errors you may encounter when using AgentMark and how to resolve them. Every error string below is a literal match from the source — search your logs for the exact text.Documentation Index
Fetch the complete documentation index at: https://docs.agentmark.co/llms.txt
Use this file to discover all available pages before exploring further.
Connection and authentication
Cannot connect to local dev server
Error (from Node fetch):fetch failed — cause: { code: 'ECONNREFUSED', address: '127.0.0.1', port: 9418, ... }
Cause: The local dev server isn’t running on the port your ApiLoader.local() is pointing at.
Solution:
- Start the dev server in a separate terminal:
- Verify it’s reachable at
http://localhost:9418. - If using a custom port:
Not authorized (401)
Error (gateway response):{"error":"Not authorized","status":401}
Cause: Your AGENTMARK_API_KEY is missing, revoked, or doesn’t match the X-Agentmark-App-Id / AGENTMARK_APP_ID you sent.
Solution:
- Verify the key in the AgentMark Dashboard.
- Make sure the app ID matches the key’s scope (keys are app-scoped).
- Update your
.env: - Restart your application so the new values are picked up.
Model registry
Model not registered
Error (TS SDK):No model function found for: 'gpt-4o'. Register it with .registerModels() or use provider/model format with .registerProviders().
Cause: The model name in your prompt frontmatter isn’t registered in your client.
Solution (TypeScript):
registerModels array of regex rejects at type-check
Error: Type 'RegExp' is not assignable to type 'string'. [TS2322]
Cause: registerModels accepts string | RegExp | Array<string> — an Array<RegExp> is not a valid overload.
Solution: Wrap the regex directly, without the surrounding array:
AI SDK v5 tool fails type-check
Error:No overload matches this call. [TS2769] on a tool({ parameters: z.object(...) }) call.
Cause: AI SDK v4 used parameters:; v5 renamed it to inputSchema:.
Solution: Use inputSchema: in v5 projects:
ai v4 tool() helper with parameters: — see Mastra integration.
MCP servers
MCP server not registered
Error (TS AI SDK adapter):MCP server 'docs' not registered. Available servers: ...
Cause: The prompt references mcp://docs/... but no server named docs is configured on createAgentMarkClient.
Solution: Add the server to your client config:
Claude Agent TS uses camelCase mcpServers, Python uses snake_case
The TypeScript adapter reads mcpServers (camelCase); the Python adapter reads mcp_servers (snake_case). The wrong casing is silently ignored — no tools will be available from the MCP server at runtime.
Prompts and files
File not found
Error (CLI run-prompt):File not found: /absolute/path/to/prompt.prompt.mdx
Cause: The path passed to run-prompt doesn’t resolve to an existing file.
Solution: Pass a path relative to your project root (e.g. agentmark/greeting.prompt.mdx).
Pre-built prompt not found
Error (FileLoader):Pre-built prompt not found: /path/to/dist/agentmark/greeting.prompt.mdx.json. Run 'agentmark build' to compile your prompts.
Cause: FileLoader reads compiled JSON from the --out directory of agentmark build. The prompt either hasn’t been built or the output directory doesn’t match.
Solution:
FileLoader points at the same directory:
agentmarkPath / breaks build
Error: AgentMark directory not found: /agentmark. Check your agentmark.json configuration.
Cause: "agentmarkPath": "/" in agentmark.json resolves to the filesystem root. The scaffolder writes "." — the relative path from the project root.
Solution: Change agentmark.json:
Invalid YAML frontmatter
Error (from the YAML parser):end of the stream or a document separator is expected (2:12) — line and column vary by the issue.
Cause: Frontmatter YAML syntax error — missing space after :, incorrect indentation, unquoted strings with special characters.
Solution:
Unterminated TemplateDX expression
Error:Unexpected end of file in expression, expected a corresponding closing brace for '{'
Cause: An open { or tag without its matching close.
Solution: Verify every {expression} has a closing } and every <Tag> has its closing </Tag>. See TemplateDX syntax.
Datasets and experiments
Dataset file not found
Check that thedataset: path in your prompt’s test_settings resolves from the prompt file’s directory:
ENOENT from Node’s fs.createReadStream. The fix is to correct the relative path.
Invalid JSONL
Each line must be a complete JSON object:cat dataset.jsonl | jq -c '.' — any line it can’t parse is the broken one.
Types
Props don’t match prompt input
WhencreateAgentMarkClient<AgentMarkTypes>() is typed, TS flags prop shape mismatches. The generated types reflect the prompt’s input_schema frontmatter — regenerate after editing:
CLI
agentmark command not found
Error: command not found: agentmark
Solution: Use npx (the CLI doesn’t need a global install):
package.json:
Port already in use
Error:EADDRINUSE: address already in use :::9418
Solution: Use a different port, or kill the existing process:
Disable CLI update banner
SetAGENTMARK_NO_UPDATE_NOTIFIER=1 in your environment to suppress the version-upgrade banner.
Still having issues?
-
Ensure your packages are current:
- Open an issue on GitHub with the exact error string, your SDK version, and a minimal reproduction.
Have Questions?
We’re here to help! Choose the best way to reach us:
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions