Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ If no API key is available, the tool returns a user-facing error.
### Core Utilities

- `msq_generate_prompt`
- `msq_run_agent_workflow`
- `msq_list_workflows`
- `msq_get_workflow`
- `msq_create_workflow`
- `msq_update_workflow`
- `msq_run_workflow`
- `msq_get_workflow_run_status`
- `msq_get_workflow_result`
- `msq_get_core_config`
- `msq_scrape_url`
- `msq_list_tools`
Expand Down Expand Up @@ -143,6 +149,24 @@ If no API key is available, the tool returns a user-facing error.
- `msq_list_user_collections`
- `msq_get_vector_store_file_details`

## Workflow Lifecycle

Workflow management uses the persisted workflow config and workflow run endpoints rather than the deprecated legacy SSE workflow route.

Supported workflow operations:

- create a workflow config with `msq_create_workflow`
- update a workflow config with `msq_update_workflow`
- list workflow configs with `msq_list_workflows`
- fetch a single workflow config with `msq_get_workflow`
- start a workflow run with `msq_run_workflow`
- inspect helper/main status with `msq_get_workflow_run_status`
- fetch the final main-agent result with `msq_get_workflow_result`

`msq_get_workflow_run_status` returns helper success/failure state without helper content.

`msq_get_workflow_result` returns only the final main-agent response and will fail if the run is still in progress or did not complete successfully.

## File Upload and Download Notes

`msq_upload_file` accepts:
Expand Down Expand Up @@ -211,6 +235,49 @@ await client.callTool('msq_embeddings', {
})
```

### Workflow example

Create a workflow:

```ts
await client.callTool('msq_create_workflow', {
name: 'Research Workflow',
mainAgentId: 'agent_main_123',
mainPrompt: 'Summarize findings from <collector|#|sourceA> and <collector|#|sourceB>',
dataPayload: '{"sourceA":"https://a.example","sourceB":"https://b.example"}',
concurrency: 2,
delimiter: '|#|',
apiKey: 'msq-...',
})
```

Start a workflow run:

```ts
await client.callTool('msq_run_workflow', {
workflowId: 'wf_123',
apiKey: 'msq-...',
})
```

Get workflow status:

```ts
await client.callTool('msq_get_workflow_run_status', {
runId: 'run_abc',
apiKey: 'msq-...',
})
```

Get the final result:

```ts
await client.callTool('msq_get_workflow_result', {
runId: 'run_abc',
apiKey: 'msq-...',
})
```

## Development

Scripts:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@missionsquad/mcp-msq",
"version": "0.2.4",
"version": "0.3.0",
"description": "MCP server interface for the MissionSquad API",
"type": "module",
"main": "dist/index.js",
Expand Down
34 changes: 26 additions & 8 deletions src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,32 @@ export const GeneratePromptSchema = z.object({
modelOptions: z.object({}).passthrough().optional(),
})

export const AgentWorkflowSchema = z.object({
agentName: NonEmptyString,
messages: z.array(ChatMessageSchema).min(1),
data: z.object({}).passthrough().optional(),
delimiter: z.string().optional(),
concurrency: z.number().int().positive().optional(),
failureMessage: z.string().optional(),
failureInstruction: z.string().optional(),
export const WorkflowIdSchema = z.object({
id: NonEmptyString.describe('Workflow config id.'),
})

export const WorkflowCreateSchema = z.object({
id: NonEmptyString.optional().describe('Optional workflow config id. If omitted, the server generates one.'),
name: z.string().optional().describe('Workflow name. Defaults to "Untitled Workflow".'),
mainAgentId: z.string().nullable().optional().describe('Main agent id for the workflow.'),
mainPrompt: z.string().optional().describe('Main prompt containing helper agent patterns.'),
dataPayload: z.string().optional().describe('JSON string containing workflow data payload. Must be valid JSON if provided.'),
concurrency: z.number().int().positive().optional().describe('Maximum concurrent helper executions.'),
delimiter: z.string().optional().describe('Delimiter used for helper patterns. Defaults to "|#|".'),
failureMessage: z.string().optional().describe('Failure message used when a helper fails.'),
failureInstruction: z.string().optional().describe('Instruction appended for the main agent when a helper fails.'),
})

export const WorkflowUpdateSchema = WorkflowIdSchema.merge(
WorkflowCreateSchema.omit({ id: true }),
)

export const WorkflowRunIdSchema = z.object({
runId: NonEmptyString.describe('Workflow run id.'),
})

export const WorkflowRunCreateSchema = z.object({
workflowId: NonEmptyString.describe('Workflow config id to execute.'),
})

export const ScrapeUrlSchema = z.object({
Expand Down
Loading
Loading