mastra-api
Skill4 starsChanged 13 months agoApache-2.0View on GitHub
Interact with Mastra development server API for debugging agents, viewing conversation threads, listing/inspecting tools and workflows, accessing observability data, and managing Mastra resources. Use when working with Mastra agents and need to inspect runtime state, debug agent errors, view thread history, see available tools/workflows, or access API endpoints at localhost:4111/api or similar ports.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- branch-surgery-pr-splitSkill
- browser-qaSkill
- create-mermaid-diagramsSkill
- create-pull-requestSkill
- git-commit-conventionalSkill
- tilt-devSkill
- uv-usageSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Run these scripts/... commands from the skills/mastra-api/ directory.
- Very specific: line 65
Check for errors: scripts/debug_agent_error.sh my-agent
- Distinctive: line 144
When UI doesn't show errors clearly:
- Distinctive: line 148
Get messages: - Use thread ID to fetch conversation
- Very specific: line 149
Look for errors: - Search for "error" or "failed" fields
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mastra Development API
Interact with the Mastra dev server API to debug agents, view conversations, inspect tools and workflows, and access observability data.
Quick Start
Agent Debugging
Run these scripts/... commands from the skills/mastra-api/ directory. From repo root, prefix them with skills/mastra-api/.
# Get latest conversation
scripts/get_latest_thread.sh <agent-id> [port]
# Debug errors
scripts/debug_agent_error.sh <agent-id> [port]
# View thread messages
curl --globoff -sS \
"http://localhost:4111/api/memory/threads/THREAD_ID/messages?page=0&perPage=50&agentId=my-agent&orderBy[field]=createdAt&orderBy[direction]=DESC" \
| jq '.'Tools and Workflows
Run these scripts/... commands from the skills/mastra-api/ directory. From repo root, prefix them with skills/mastra-api/.
# List all tools
scripts/list_tools.sh [port]
# List all workflows
scripts/list_workflows.sh [port]
# Get workflow details
scripts/get_workflow_details.sh <workflow-name> [port]
# Get workflow runs
scripts/get_workflow_runs.sh <workflow-name> [port]Resource Listing
# List all agents
curl -sS http://localhost:4111/api/agents | jq 'keys'
# List all tools
curl -sS http://localhost:4111/api/tools | jq 'keys'
# List all workflows
curl -sS http://localhost:4111/api/workflows | jq 'keys'Common Tasks
Debug Agent Failures
- Get latest thread:
scripts/get_latest_thread.sh my-agent - Check for errors:
scripts/debug_agent_error.sh my-agent - Inspect message content for error details
Inspect Available Resources
# See what tools an agent can use
curl -sS http://localhost:4111/api/agents | \
jq '.["my-agent"].tools | keys'
# See what workflows an agent can invoke
curl -sS http://localhost:4111/api/agents | \
jq '.["my-agent"].workflows | keys'
# List all registered tools
scripts/list_tools.sh
# List all registered workflows
scripts/list_workflows.shDebug Workflows
# Get workflow structure and steps
scripts/get_workflow_details.sh my-workflow
# Check workflow execution history
scripts/get_workflow_runs.sh my-workflow
# Find failed workflow runs
scripts/get_workflow_runs.sh my-workflow | \
jq '.runs[] | select(.status == "failed")'Check Tool/Workflow Schemas
# Get tool input parameters
curl -sS http://localhost:4111/api/tools | \
jq '.YOUR_TOOL_KEY.inputSchema | fromjson.json.properties | keys'
# Get workflow input requirements
curl -sS http://localhost:4111/api/workflows/my-workflow | \
jq '.inputSchema | fromjson.json.properties | keys'Access Observability Data
# Get traces
curl -sS http://localhost:4111/api/observability/traces | jq '.'
# Get logs
curl -sS http://localhost:4111/api/logs | jq '.'Important Notes
Use --globoff with curl
Query parameters with brackets must use --globoff:
curl --globoff -sS "...&orderBy[field]=updatedAt&orderBy[direction]=DESC"Without --globoff, curl treats [...] as character ranges.
API Base URLs
Standard: http://localhost:4111/api
Swagger Documentation
Complete interactive API docs: http://localhost:4111/swagger-ui
Debugging Workflow
When UI doesn't show errors clearly:
- Get latest thread -
scripts/get_latest_thread.sh <agent-id> - Extract thread ID from response
- Get messages - Use thread ID to fetch conversation
- Look for errors - Search for
"error"or"failed"fields - Review content - Inspect message content for details
This is the fastest way to debug agent issues.
Reference
See references/api_endpoints.md for:
- Complete endpoint reference
- Query parameter details
- Pagination and ordering
- Project-specific configurations
- Error handling patterns
See references/tools_and_workflows.md for:
- Tools API documentation
- Workflows API documentation
- Schema parsing examples
- Integration with agents
- Common debugging patterns
Scripts
Agent Debugging
scripts/get_latest_thread.sh <agent-id> [port] [detailed]- Get latest conversation threadscripts/debug_agent_error.sh <agent-id> [port]- Quick error debugging
Tools & Workflows
scripts/list_tools.sh [port]- List all registered tools with descriptionsscripts/list_workflows.sh [port]- List all registered workflows with stepsscripts/get_workflow_details.sh <workflow-name> [port]- Get detailed workflow informationscripts/get_workflow_runs.sh <workflow-name> [port] [page] [perPage]- Get workflow execution history
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

