# SketricGen MCP

> SketricGen connects your AI agents directly to a multi-agent workflow engine. It lets your agent run complex, programmatic workflows; query searchable knowledge bases using vector search; debug execution traces step-by-step; and interact with contact profiles and conversation history.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** workflow-automation, multi-agent-systems, knowledge-base, execution-tracing, ai-templates, credit-tracking

## Description

Listen up, this server isn't just some chat wrapper; it connects your AI agent straight into a **multi-agent workflow engine**. You can use your agent to run complex business logic programs end-to-end. 

When you need the system running, you kick off predefined sequences using `run_workflow`, or if the process needs specific customer details, you call `run_workflow_with_contact` so it automatically injects that profile info into the context. You don't have to guess what steps are available; you can first check out all the blueprints by calling `list_templates` and then grab the structural definition of any existing workflow using `get_workflow`. 

For managing your agents themselves, you list everything available with `list_agents`, and if you need deep intel on one specific component, you fetch its details with `get_agent`. 

If the AI needs to talk about customers, it's got access to CRM-style data. You can pull all stored contact profiles using `list_contacts` or grab the full profile for a known person by calling `get_contact`. 

When context is everything—and it always is—you can manage external knowledge bases. The system lets you list every available corpus with `list_knowledge_bases`, and then you pull details on any specific one using `get_knowledge_base` so your agent knows where to find the right facts.

If things go sideways or you gotta prove how a task was completed, you can track it down. You get the full sequence of actions and data exchange from a past run by calling `get_trace`. This tool shows exactly which underlying tools ran, what inputs were fed into them, and what the final output was. You also check resource usage—you calculate how many credits were burned on a specific run with `get_trace_credits`, and you can review history logs by getting a directory of completed execution traces using `list_traces`. 

To keep tabs on conversations or workflows that happened before, you've got full visibility. You list every past conversation record with `list_conversations`, grab the entire transcript and context for any single chat via `get_conversation`, and if you need to wipe a mess clean, you permanently delete that history using `delete_conversation`. 

You can also check the server's operational status instantly by calling `check_sketricgen_status` to make sure everything's connected right. Finally, when you just want a quick look at what templates or workflows exist without running them, you list all available workflow templates using `list_workflows`, and you get an overview of every stored conversation record with `list_conversations`. That’s the whole shebang.

## Tools

### check_sketricgen_status
Verifies the live connection status of the SketricGen server.

### delete_conversation
Permanently deletes a specific conversation history record.

### get_agent
Retrieves detailed information about a single AI agent component.

### get_contact
Fetches the profile details for a specific contact record using identifiers.

### get_conversation
Retrieves the full transcript and context of a defined conversation history.

### get_knowledge_base
Pulls details about a specific, searchable knowledge base.

### get_trace_credits
Calculates and reports how many resource credits were used by a specific workflow run.

### get_trace
Retrieves the complete sequence and output of a past workflow execution trace.

### get_workflow
Gets the structural definition and parameters of an existing workflow template.

### list_agents
Returns a list summarizing all available AI agents managed by the system.

### list_contacts
Lists all contact profiles that are currently stored and accessible.

### list_conversations
Shows a directory of past conversation records, including their IDs and dates.

### list_knowledge_bases
Returns a list of all knowledge bases available for querying and context injection.

### list_templates
Lists various predefined templates that can be used to build new workflows.

### list_traces
Provides a directory of completed execution traces, allowing history review.

### list_workflows
Lists all available workflow templates and their current status.

### run_workflow_with_contact
Runs a workflow, automatically injecting details from a specific contact profile into the context.

### run_workflow
Executes a specified workflow template using general parameters.

## Prompt Examples

**Prompt:** 
```
Run my customer support agent workflow in SketricGen with the question 'How do I reset my password?'
```

**Response:** 
```
I've successfully triggered the customer support workflow. The agent accessed the 'Password Reset Guide' from your knowledge base and generated a step-by-step response. Would you like me to send this reply to the user?
```

**Prompt:** 
```
Show me the execution trace and credit usage for my last SketricGen workflow run.
```

**Response:** 
```
Retrieving the execution trace... Your last workflow completed in 4.2 seconds and consumed 15 credits. It successfully executed 3 tool calls and queried the main knowledge base once. Do you want to see the specific input and output for each node?
```

**Prompt:** 
```
List all knowledge bases in SketricGen and show which agents are connected to each.
```

**Response:** 
```
You have two active knowledge bases: 'Internal HR Docs' (connected to the HR Assistant agent) and 'Public FAQs' (connected to the Support Bot and Sales Bot). The 'Public FAQs' base currently contains 45 indexed documents.
```

## Capabilities

### Execute Agent Workflows
Your agent triggers predefined business logic sequences and runs them end-to-end using the `run_workflow` tool.

### Manage Knowledge Bases
The server allows your AI client to list, get details on, and query external knowledge bases for context retrieval.

### Inspect Execution Flow
You pull detailed execution traces via `get_trace` to see exactly which tools ran, what data was passed, and how many credits were consumed.

### Retrieve Contact Data
The agent accesses CRM-style contact information using the `get_contact` tool or lists all available contacts with `list_contacts`.

### Coordinate Agents
You list and retrieve details for individual agents (`list_agents`, `get_agent`) to manage multi-agent system components.

## Use Cases

### Support Agent Triage
A user asks about an account issue. Your agent first calls `get_contact` to pull account details, then uses `run_workflow_with_contact` to run the 'Tier 2 Support' process. The workflow accesses `get_knowledge_base` for policy answers and returns a fully contextualized resolution.

### Debugging Agent Failure
The agent failed mid-task. Instead of just getting an error message, you call `list_traces` to find the run ID, then use `get_trace` to pinpoint which specific tool call (and its inputs) caused the failure. This isolates the bug instantly.

### Marketing Campaign Automation
The marketing team needs a report on VIP clients. They ask the agent, which uses `list_contacts` to pull all 'VIP' records and then calls `run_workflow` with the compiled list, generating an aggregate report file.

### Internal Policy Query
A new employee asks about PTO policy. The agent checks `list_knowledge_bases` to find the 'HR Policies' base, then runs a query using `get_knowledge_base`, providing an answer backed by specific section citations.

## Benefits

- See exactly how agents work. Instead of just a final answer, `get_trace` shows the full step-by-step execution path, including which tools fired and what data came back for each node.
- Stop guessing about costs. Use `get_trace_credits` to check resource usage per run, letting you accurately budget and optimize your agentic systems before they go live.
- Context matters. The ability to inject specific contacts using `run_workflow_with_contact` means the agent has immediate access to relevant CRM data, improving accuracy on first try.
- Manage state reliably. Tools like `list_conversations` and `delete_conversation` let your client handle conversation history explicitly—you control what context is available.
- Build robust systems with structure. You can list templates (`list_templates`) before running a workflow, ensuring you use the correct, validated process every time.

## How It Works

The bottom line is: It gives your AI client API access to run complex business logic—not just talk about it.

1. First, subscribe to the server on Vinkius and enter your SketricGen API Key.
2. Next, instruct your AI client (e.g., Claude or Cursor) to use a specific tool name, like `run_workflow`.
3. The server executes the workflow, returns the structured output (data/trace), which your agent then processes and presents to you.

## Frequently Asked Questions

**How do I debug a failed agent task using get_trace?**
You call `list_traces` to find the run ID, then use `get_trace` with that ID. This shows every tool called and its specific input/output pair, letting you pinpoint exactly where the process broke.

**Does run_workflow_with_contact give me CRM data?**
Yes. It runs a workflow while automatically injecting context from a specified contact profile using `get_contact`. This ensures the agent's actions are grounded in real-time client data.

**What is the difference between list_agents and get_agent?**
`list_agents` shows you names of all agents available. You use `get_agent` when you need specific, deep details about one agent's configuration or capabilities.

**Can I track how much an agent uses? How is it done with get_trace_credits?**
The `get_trace_credits` tool calculates the cost associated with a run. This lets you monitor resource usage and optimize your workflows to minimize token or compute consumption.

**I need to query external documentation; should I use list_knowledge_bases first?**
Yes. First, use `list_knowledge_bases` to confirm the correct base name. Then, you can use `get_knowledge_base` or let your workflow trigger the retrieval process.

**How do I test if my API credentials are valid using `check_sketricgen_status`?**
You run `check_sketricgen_status`. This verifies your connection to the SketricGen platform and confirms your API key is active. It's the first thing you should do before building complex, multi-agent workflows.

**If I need to remove a user’s data after a session, how do I use `delete_conversation`?**
Call `delete_conversation`. This immediately purges the specific chat history from SketricGen's records. It is your tool for maintaining strict conversation privacy and compliance.

**Before building a new agent flow, should I use `list_templates` to see existing options?**
Yes, check `list_templates`. This shows you pre-built workflow blueprints. Using an existing template lets you adapt proven structures instead of starting from scratch.

**How can my AI analyze the execution steps of a specific workflow?**
Simply use the `debug_workflow_trace` tool. Your agent will instantly retrieve the execution trace, detailing every tool call, data transfer between agents, and total credit consumption per run.

**Is it possible to programmatically manage and query documents for my agents?**
Yes. By executing the `manage_knowledge_base` action, your AI agent can upload files (PDF, DOCX, TXT, HTML) or search existing repositories to provide context-aware, highly accurate responses.

**Can I automatically trigger workflows tied to specific customer records?**
Absolutely. Ask the agent to use the `run_workflow_for_contact` tool. It will execute the designated workflow while injecting the specific contact's history, enabling personalized, data-driven outputs.