Skip to content

Commit e5227f2

Browse files
committed
Ellicitation support for Stage 1 Inputs, Added ResourcesService
1 parent 01df031 commit e5227f2

28 files changed

+5076
-151
lines changed

tools/Mcp/src/CodegenServer.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
22
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
33
import { z } from "zod";
4-
import { responseSchema, toolParameterSchema, toolSchema, promptSchema } from "./types.js";
4+
import { responseSchema, toolParameterSchema, toolSchema, promptSchema, resourceSchema } from "./types.js";
55
import { ToolsService } from "./services/toolsService.js";
66
import { PromptsService } from "./services/promptsService.js";
7+
import { ResourcesService } from "./services/resourcesService.js";
78
import { readFileSync } from "fs";
89
import path from "path";
910
import { fileURLToPath } from "url";
@@ -37,6 +38,7 @@ export class CodegenServer {
3738
this.initResponses();
3839
this.initTools();
3940
this.initPrompts();
41+
this.initResources();
4042
}
4143

4244
// dummy method for sending sampling request
@@ -74,6 +76,9 @@ export class CodegenServer {
7476
await this._mcp.connect(transport);
7577
}
7678

79+
public getResponseTemplate(name: string): string | undefined {
80+
return this._responses.get(name);
81+
}
7782

7883
initTools() {
7984
const toolsService = ToolsService.getInstance().setServer(this);
@@ -105,6 +110,21 @@ export class CodegenServer {
105110
}
106111
}
107112

113+
initResources() {
114+
const resourcesService = ResourcesService.getInstance().setServer(this);
115+
const resourcesSchemas = (specs.resources || []) as resourceSchema[];
116+
for (const schema of resourcesSchemas) {
117+
const parameter = resourcesService.createResourceParametersFromSchema(schema.parameters || []);
118+
const callback = resourcesService.getResources(schema.callbackName, this._responses.get(schema.name));
119+
this._mcp.resource(
120+
schema.name,
121+
schema.description,
122+
parameter,
123+
(args: any) => callback(args)
124+
);
125+
}
126+
}
127+
108128
initResponses() {
109129
(responses as responseSchema[])?.forEach((response: responseSchema) => {
110130
let text = response.text;
@@ -120,4 +140,6 @@ export class CodegenServer {
120140
this._responses.set(response.name, text);
121141
});
122142
}
143+
144+
123145
}
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
external help file: Az.Databricks-help.xml
3+
Module Name: Az.Databricks
4+
online version: https://learn.microsoft.com/powershell/module/az.databricks/get-azdatabricksaccessconnector
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzDatabricksAccessConnector
9+
10+
## SYNOPSIS
11+
Gets an Azure Databricks Access Connector.
12+
13+
## SYNTAX
14+
15+
### List1 (Default)
16+
```
17+
Get-AzDatabricksAccessConnector [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>]
18+
[<CommonParameters>]
19+
```
20+
21+
### Get
22+
```
23+
Get-AzDatabricksAccessConnector -Name <String> -ResourceGroupName <String> [-SubscriptionId <String[]>]
24+
[-DefaultProfile <PSObject>] [<CommonParameters>]
25+
```
26+
27+
### List
28+
```
29+
Get-AzDatabricksAccessConnector -ResourceGroupName <String> [-SubscriptionId <String[]>]
30+
[-DefaultProfile <PSObject>] [<CommonParameters>]
31+
```
32+
33+
### GetViaIdentity
34+
```
35+
Get-AzDatabricksAccessConnector -InputObject <IDatabricksIdentity> [-DefaultProfile <PSObject>]
36+
[<CommonParameters>]
37+
```
38+
39+
## DESCRIPTION
40+
Gets an Azure Databricks Access Connector.
41+
42+
## EXAMPLES
43+
44+
### Example 1: List all access connectors under a subscription.
45+
```powershell
46+
Get-AzDatabricksAccessConnector
47+
```
48+
49+
```output
50+
Location Name ResourceGroupName
51+
-------- ---- -----------------
52+
eastus azps-databricks-accessconnector azps_test_gp_db
53+
```
54+
55+
This command lists all access connectors under a subscription.
56+
57+
### Example 2: List all access connectors under a resource group.
58+
```powershell
59+
Get-AzDatabricksAccessConnector -ResourceGroupName azps_test_gp_db
60+
```
61+
62+
```output
63+
Location Name ResourceGroupName
64+
-------- ---- -----------------
65+
eastus azps-databricks-accessconnector azps_test_gp_db
66+
```
67+
68+
This command lists all access connectors under a resource group.
69+
70+
### Example 3: Get a access connectors by name.
71+
```powershell
72+
Get-AzDatabricksAccessConnector -ResourceGroupName azps_test_gp_db -Name azps-databricks-accessconnector
73+
```
74+
75+
```output
76+
Location Name ResourceGroupName
77+
-------- ---- -----------------
78+
eastus azps-databricks-accessconnector azps_test_gp_db
79+
```
80+
81+
This command gets a access connectors by name.
82+
83+
## PARAMETERS
84+
85+
### -DefaultProfile
86+
The DefaultProfile parameter is not functional.
87+
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
88+
89+
```yaml
90+
Type: System.Management.Automation.PSObject
91+
Parameter Sets: (All)
92+
Aliases: AzureRMContext, AzureCredential
93+
94+
Required: False
95+
Position: Named
96+
Default value: None
97+
Accept pipeline input: False
98+
Accept wildcard characters: False
99+
```
100+
101+
### -InputObject
102+
Identity Parameter
103+
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
104+
105+
```yaml
106+
Type: Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IDatabricksIdentity
107+
Parameter Sets: GetViaIdentity
108+
Aliases:
109+
110+
Required: True
111+
Position: Named
112+
Default value: None
113+
Accept pipeline input: True (ByValue)
114+
Accept wildcard characters: False
115+
```
116+
117+
### -Name
118+
The name of the Azure Databricks Access Connector.
119+
120+
```yaml
121+
Type: System.String
122+
Parameter Sets: Get
123+
Aliases:
124+
125+
Required: True
126+
Position: Named
127+
Default value: None
128+
Accept pipeline input: False
129+
Accept wildcard characters: False
130+
```
131+
132+
### -ResourceGroupName
133+
The name of the resource group.
134+
The name is case insensitive.
135+
136+
```yaml
137+
Type: System.String
138+
Parameter Sets: Get, List
139+
Aliases:
140+
141+
Required: True
142+
Position: Named
143+
Default value: None
144+
Accept pipeline input: False
145+
Accept wildcard characters: False
146+
```
147+
148+
### -SubscriptionId
149+
The ID of the target subscription.
150+
The value must be an UUID.
151+
152+
```yaml
153+
Type: System.String[]
154+
Parameter Sets: List1, Get, List
155+
Aliases:
156+
157+
Required: False
158+
Position: Named
159+
Default value: (Get-AzContext).Subscription.Id
160+
Accept pipeline input: False
161+
Accept wildcard characters: False
162+
```
163+
164+
### CommonParameters
165+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
166+
167+
## INPUTS
168+
169+
### Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.IDatabricksIdentity
170+
171+
## OUTPUTS
172+
173+
### Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20240501.IAccessConnector
174+
175+
## NOTES
176+
177+
## RELATED LINKS
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
external help file: Az.Databricks-help.xml
3+
Module Name: Az.Databricks
4+
online version: https://learn.microsoft.com/powershell/module/az.databricks/get-azdatabricksoutboundnetworkdependenciesendpoint
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzDatabricksOutboundNetworkDependenciesEndpoint
9+
10+
## SYNOPSIS
11+
Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane.
12+
You must configure outbound access with these endpoints.
13+
For more information, see https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr
14+
15+
## SYNTAX
16+
17+
```
18+
Get-AzDatabricksOutboundNetworkDependenciesEndpoint -ResourceGroupName <String> -WorkspaceName <String>
19+
[-SubscriptionId <String[]>] [-DefaultProfile <PSObject>]
20+
[<CommonParameters>]
21+
```
22+
23+
## DESCRIPTION
24+
Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane.
25+
You must configure outbound access with these endpoints.
26+
For more information, see https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr
27+
28+
## EXAMPLES
29+
30+
### Example 1: Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane.
31+
```powershell
32+
Get-AzDatabricksOutboundNetworkDependenciesEndpoint -ResourceGroupName azps_test_gp_db -WorkspaceName azps-databricks-workspace-t2
33+
```
34+
35+
```output
36+
Category
37+
--------
38+
Webapp
39+
Control Plane NAT
40+
Extended infrastructure
41+
Azure Storage
42+
Azure My SQL
43+
Azure Servicebus
44+
```
45+
46+
This command gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane.
47+
You must configure outbound access with these endpoints.
48+
For more information, see https://learn.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr
49+
50+
## PARAMETERS
51+
52+
### -DefaultProfile
53+
The DefaultProfile parameter is not functional.
54+
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
55+
56+
```yaml
57+
Type: System.Management.Automation.PSObject
58+
Parameter Sets: (All)
59+
Aliases: AzureRMContext, AzureCredential
60+
61+
Required: False
62+
Position: Named
63+
Default value: None
64+
Accept pipeline input: False
65+
Accept wildcard characters: False
66+
```
67+
68+
### -ResourceGroupName
69+
The name of the resource group.
70+
The name is case insensitive.
71+
72+
```yaml
73+
Type: System.String
74+
Parameter Sets: (All)
75+
Aliases:
76+
77+
Required: True
78+
Position: Named
79+
Default value: None
80+
Accept pipeline input: False
81+
Accept wildcard characters: False
82+
```
83+
84+
### -SubscriptionId
85+
The ID of the target subscription.
86+
The value must be an UUID.
87+
88+
```yaml
89+
Type: System.String[]
90+
Parameter Sets: (All)
91+
Aliases:
92+
93+
Required: False
94+
Position: Named
95+
Default value: (Get-AzContext).Subscription.Id
96+
Accept pipeline input: False
97+
Accept wildcard characters: False
98+
```
99+
100+
### -WorkspaceName
101+
The name of the workspace.
102+
103+
```yaml
104+
Type: System.String
105+
Parameter Sets: (All)
106+
Aliases:
107+
108+
Required: True
109+
Position: Named
110+
Default value: None
111+
Accept pipeline input: False
112+
Accept wildcard characters: False
113+
```
114+
115+
### CommonParameters
116+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
117+
118+
## INPUTS
119+
120+
## OUTPUTS
121+
122+
### Microsoft.Azure.PowerShell.Cmdlets.Databricks.Models.Api20240501.IOutboundEnvironmentEndpoint
123+
124+
## NOTES
125+
126+
## RELATED LINKS

0 commit comments

Comments
 (0)