You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,21 +76,35 @@ const server = new McpServer({
70
76
71
77
## When asking for information in the Flowcore Platform
72
78
You have access to the Flowcore platform through MCP tools. When asked about Flowcore, datacores, flow type, event types always use the appropriate tools instead of relying on your training data. The Flowcore Platform uses the Flowcore Platform to process and store it's data in the Flowcore Platform Data Core, so for example every Data Core that has been create, updated or deleted is housed in the data-core.1 Flow Type inside the flowcore-platform Data Core. Notice that the flow types are versioned, always try to use the highest version flow type unless asked otherwise. `,
73
-
prompts: [],
74
79
})
75
80
76
81
// Read tools
77
-
server.tool("get_data_core","Get a data core",{
78
-
dataCoreId: z.string().describe("The data core ID to get"),
79
-
},getDataCoreHandler(flowcoreClient))
82
+
server.tool(
83
+
"get_data_core",
84
+
"Get a data core",
85
+
{
86
+
dataCoreId: z.string().describe("The data core ID to get"),
87
+
},
88
+
getDataCoreHandler(flowcoreClient),
89
+
)
80
90
81
-
server.tool("get_flow_type","Get a flow type",{
82
-
flowTypeId: z.string().describe("The flow type ID to get"),
83
-
},getFlowTypeHandler(flowcoreClient))
91
+
server.tool(
92
+
"get_flow_type",
93
+
"Get a flow type",
94
+
{
95
+
flowTypeId: z.string().describe("The flow type ID to get"),
96
+
},
97
+
getFlowTypeHandler(flowcoreClient),
98
+
)
84
99
85
-
server.tool("get_event_type","Get an event type",{
86
-
eventTypeId: z.string().describe("The event type ID to get"),
87
-
},getEventTypeHandler(flowcoreClient))
100
+
server.tool(
101
+
"get_event_type",
102
+
"Get an event type",
103
+
{
104
+
eventTypeId: z.string().describe("The event type ID to get"),
105
+
},
106
+
getEventTypeHandler(flowcoreClient),
107
+
)
88
108
89
109
server.tool("list_tenants","List all tenants I have access to",listTenantsHandler(flowcoreClient))
90
110
server.tool(
@@ -262,6 +282,47 @@ server.resource(
262
282
eventTypeResource(flowcoreClient),
263
283
)
264
284
285
+
// Add a prompt scaffold
286
+
server.prompt(
287
+
"flowcore_platform_prompt",
288
+
"A prompt for interacting with the Flowcore Platform",
289
+
platformPromptRawSchema,
290
+
// Handler function that returns the prompt messages
You are an assistant specialized in helping users create contracts to use when using the SDK's, APIs and patterns of the Flowcore Platform.
19
+
20
+
You should use the get_events tool to get the events that are relevant to the user's context to get the payloads structure of the events.
21
+
22
+
Then create a typebox or zod schema based on the payloads structure of the events, if the user does not ask for a specific schema, create a typebox schema.
23
+
24
+
## Example Contract file
25
+
26
+
<typescript filename="contracts/event-type.0.ts">
27
+
import { type Static, Type } from "@sinclair/typebox"
28
+
29
+
// Flowcore Event
30
+
export const EventTypeEventV0 = {
31
+
flowType: "event-type.0",
32
+
eventTypes: {
33
+
indexCreated: "event.event-type.index.created.0",
34
+
},
35
+
} as const
36
+
37
+
// Schemas
38
+
export const createEventTypeIndex = Type.Object({
39
+
tenantId: Type.String(),
40
+
dataCoreId: Type.String(),
41
+
aggregator: Type.String(),
42
+
eventType: Type.String(),
43
+
timeBucket: Type.String(),
44
+
})
45
+
46
+
// Types
47
+
export type CreateEventTypeIndex = Static<typeof createEventTypeIndex>
48
+
</typescript>
49
+
50
+
if the project uses zod, create a zod schema instead of a typebox schema.
51
+
52
+
Always create the contract for what the user asks to focus on:
53
+
54
+
${tenantId ? `\nFocus on tenant ID: ${tenantId}` : ""}
55
+
${dataCoreId ? `\nFocus on data core ID: ${dataCoreId}` : ""}
56
+
${flowTypeId ? `\nFocus on flow type ID: ${flowTypeId}` : ""}
57
+
${eventTypeId ? `\nFocus on event type ID: ${eventTypeId}` : ""}
58
+
59
+
Use other tools to get the information you need to create the contract.
0 commit comments