Skip to content

Commit b809df4

Browse files
committed
Update dsl-reference.md Signed-off-by: Amin Nikanjam <[email protected]>
Signed-off-by: amin-nikanjam <[email protected]> Signed-off-by: Amin <[email protected]>
1 parent cc6cf59 commit b809df4

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

dsl-reference.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
+ [HTTP](#http-call)
1616
+ [OpenAPI](#openapi-call)
1717
+ [A2A](#a2a-call)
18+
+ [MCP](#mcp-call)
1819
- [Do](#do)
1920
- [Emit](#emit)
2021
- [For](#for)
@@ -322,6 +323,7 @@ Serverless Workflow defines several default functions that **MUST** be supported
322323
- [HTTP](#http-call)
323324
- [OpenAPI](#openapi-call)
324325
- [A2A](#a2a-call)
326+
- [MCP](#mcp-call)
325327

326328
##### AsyncAPI Call
327329

@@ -527,6 +529,71 @@ do:
527529
text: Generate the Q1 sales report.
528530
```
529531

532+
##### MCP Call
533+
534+
The [MCP Call](#mcp-call) enables workflows to interact with MCP servers that are used by AI agents (https://modelcontextprotocol.io/).
535+
536+
###### Properties
537+
538+
| Name | Type | Required | Description|
539+
|:--|:---:|:---:|:---|
540+
| method | `string` | `yes` | The MCP JSON-RPC method to send.<br>*Supported values are: `initialize`, `notifications/initialized`, `prompts/list`, `prompts/get`, `notifications/prompts/list_changed`, `resources/list`, `resources/read`, `resources/templates/list`, `notifications/resources/list_changed`, `tools/list`, `tools/call`, `notifications/tools/list_changed`, `logging/setLevel`, and `notifications/message`* |
541+
| server | `string`\|[`endpoint`](#endpoint) | `yes` | An URI, an object (for HTTP) or a filename (for STDIO) that describes the MCP server to call.<br>|
542+
| parameters | `map` <br> `string` | `no` | The parameters for the MCP RPC method. For the `initialize` method, runtimes must set the `protocolVersion` parameter to the used version. Runtimes must implement the MCP specification version of 2025-06-18. <br>*Can be an object or a runtime expression.* |
543+
544+
> [!NOTE]
545+
> On success the output is the JSON-RPC result. On failure runtimes must raise an error with type [https://serverlessworkflow.io/spec/1.0.0/errors/runtime](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#standard-error-types).
546+
>
547+
> This call supports MCP over both HTTP and STDIO (communication over standard in and standard out) transport mechanisms.
548+
549+
###### Examples
550+
551+
This example shows an initialization phase as the first interaction between MCP client and server. The client sends its supported version, capabilities, and implementation information in the initialize request. The server MUST respond with its own capabilities and information including the supported version.
552+
553+
```yaml
554+
document:
555+
dsl: '1.0.1'
556+
namespace: test
557+
name: mcp-example
558+
version: '0.1.0'
559+
do:
560+
- GenerateReport:
561+
call: mcp
562+
with:
563+
method: initialize
564+
server:
565+
endpoint: https://example.com/mcp
566+
parameters:
567+
protocolVersion: '2025-03-26'
568+
capabilities:
569+
roots:
570+
listChanged: true
571+
clientInfo:
572+
name: 'ExampleClient'
573+
version: '1.0.0'
574+
```
575+
576+
The following example showcases a prompts/list request by the client to retrieve available prompts from the MCP server.
577+
578+
```yaml
579+
document:
580+
dsl: '1.0.1'
581+
namespace: test
582+
name: mcp-example
583+
version: '0.1.0'
584+
do:
585+
- GenerateReport:
586+
call: mcp
587+
with:
588+
method: prompts/get
589+
server:
590+
endpoint: https://example.com/mcp
591+
parameters:
592+
name: "code_review"
593+
arguments:
594+
code: "def hello():\n print('world')"
595+
```
596+
530597
#### Do
531598

532599
Serves as a fundamental building block within workflows, enabling the sequential execution of multiple subtasks. By defining a series of subtasks to perform in sequence, the Do task facilitates the efficient execution of complex operations, ensuring that each subtask is completed before the next one begins.
@@ -2706,4 +2773,4 @@ References a workflow definition.
27062773
name: greet
27072774
namespace: samples
27082775
version: '0.1.0-rc2'
2709-
```
2776+
```

0 commit comments

Comments
 (0)