forked from forcedotcom/mobile-mcp-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata.ts
More file actions
55 lines (48 loc) · 1.73 KB
/
metadata.ts
File metadata and controls
55 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright (c) 2025, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: MIT
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import z from 'zod';
import {
WORKFLOW_TOOL_BASE_INPUT_SCHEMA,
MCP_WORKFLOW_TOOL_OUTPUT_SCHEMA,
WorkflowToolMetadata,
} from '@salesforce/magen-mcp-workflow';
/**
* Schema for Salesforce org information
*/
export const ORG_INFO_SCHEMA = z.object({
username: z.string().describe('The username of the Salesforce org'),
alias: z.string().optional().describe('The alias of the Salesforce org'),
});
export type OrgInfoInput = z.infer<typeof ORG_INFO_SCHEMA>;
/**
* Org Selection Tool Input Schema
*/
export const ORG_SELECTION_WORKFLOW_INPUT_SCHEMA = WORKFLOW_TOOL_BASE_INPUT_SCHEMA.extend({
orgList: z
.array(ORG_INFO_SCHEMA)
.describe('The list of connected Salesforce orgs available for selection'),
});
export type OrgSelectionWorkflowInput = z.infer<typeof ORG_SELECTION_WORKFLOW_INPUT_SCHEMA>;
export const ORG_SELECTION_WORKFLOW_RESULT_SCHEMA = z.object({
selectedOrgUsername: z
.string()
.describe('The username of the Salesforce org selected by the user'),
});
/**
* Org Selection Tool Metadata
*/
export const ORG_SELECTION_TOOL: WorkflowToolMetadata<
typeof ORG_SELECTION_WORKFLOW_INPUT_SCHEMA,
typeof ORG_SELECTION_WORKFLOW_RESULT_SCHEMA
> = {
toolId: 'sfmobile-native-org-selection',
title: 'Salesforce Mobile Native Org Selection',
description: 'Guides user through selecting a Salesforce org from the available connected orgs',
inputSchema: ORG_SELECTION_WORKFLOW_INPUT_SCHEMA,
outputSchema: MCP_WORKFLOW_TOOL_OUTPUT_SCHEMA,
resultSchema: ORG_SELECTION_WORKFLOW_RESULT_SCHEMA,
} as const;