Skip to content

Commit f69252c

Browse files
committed
Replace per-operation MCP tools with three meta-tools (search, describe, call) (#857)
Synced from sferarc/pgbeam@e56ff3e
1 parent 0549551 commit f69252c

7 files changed

Lines changed: 111 additions & 3 deletions

File tree

src/generated/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export type { Region, RegionProviderEnumKey, RegionStatusEnumKey } from "./types
109109
export type { RejectApprovalRequestData, RejectApprovalRequestPathApprovalId, RejectApprovalRequestPathProjectId, RejectApprovalRequestRequestConfig, RejectApprovalRequestResponse, RejectApprovalRequestResponses, RejectApprovalRequestStatus200, RejectApprovalRequestStatus400, RejectApprovalRequestStatus401, RejectApprovalRequestStatus403, RejectApprovalRequestStatus404, RejectApprovalRequestStatus409 } from "./types/RejectApprovalRequest";
110110
export type { Replica } from "./types/Replica";
111111
export type { RevokeAgentCredentialPathAgentId, RevokeAgentCredentialPathProjectId, RevokeAgentCredentialRequestConfig, RevokeAgentCredentialResponse, RevokeAgentCredentialResponses, RevokeAgentCredentialStatus204, RevokeAgentCredentialStatus400, RevokeAgentCredentialStatus401, RevokeAgentCredentialStatus403, RevokeAgentCredentialStatus404 } from "./types/RevokeAgentCredential";
112+
export type { RotateAgentCredentialPathAgentId, RotateAgentCredentialPathProjectId, RotateAgentCredentialRequestConfig, RotateAgentCredentialResponse, RotateAgentCredentialResponses, RotateAgentCredentialStatus200, RotateAgentCredentialStatus400, RotateAgentCredentialStatus401, RotateAgentCredentialStatus403, RotateAgentCredentialStatus404, RotateAgentCredentialStatus409 } from "./types/RotateAgentCredential";
112113
export type { RowFilter } from "./types/RowFilter";
113114
export type { SSLModeKey } from "./types/SSLMode";
114115
export type { StatementRules } from "./types/StatementRules";

src/generated/operations-map.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { CreateAgentCredentialRequestConfig, CreateAgentCredentialStatus201
99
import type { GetAgentCredentialRequestConfig, GetAgentCredentialStatus200 } from "./types/GetAgentCredential";
1010
import type { UpdateAgentCredentialStatusRequestConfig, UpdateAgentCredentialStatusStatus200 } from "./types/UpdateAgentCredentialStatus";
1111
import type { RevokeAgentCredentialRequestConfig } from "./types/RevokeAgentCredential";
12+
import type { RotateAgentCredentialRequestConfig, RotateAgentCredentialStatus200 } from "./types/RotateAgentCredential";
1213
import type { ListAnomalyAlertsRequestConfig, ListAnomalyAlertsStatus200 } from "./types/ListAnomalyAlerts";
1314
import type { UpdateAnomalyAlertRequestConfig, UpdateAnomalyAlertStatus200 } from "./types/UpdateAnomalyAlert";
1415
import type { ListApprovalRequestsRequestConfig, ListApprovalRequestsStatus200 } from "./types/ListApprovalRequests";
@@ -74,6 +75,7 @@ export const operationsByTag = {
7475
getAgentCredential: { method: "GET", path: "/v1/projects/{project_id}/agents/{agent_id}" },
7576
updateAgentCredentialStatus: { method: "PATCH", path: "/v1/projects/{project_id}/agents/{agent_id}" },
7677
revokeAgentCredential: { method: "DELETE", path: "/v1/projects/{project_id}/agents/{agent_id}" },
78+
rotateAgentCredential: { method: "POST", path: "/v1/projects/{project_id}/agents/{agent_id}/rotate" },
7779
listAuditLogs: { method: "GET", path: "/v1/projects/{project_id}/audit-logs" },
7880
},
7981
anomalies: {
@@ -154,6 +156,7 @@ export const operationsByPath = {
154156
"GET /v1/projects/{project_id}/agents/{agent_id}": { method: "GET", path: "/v1/projects/{project_id}/agents/{agent_id}", operationId: "getAgentCredential" },
155157
"PATCH /v1/projects/{project_id}/agents/{agent_id}": { method: "PATCH", path: "/v1/projects/{project_id}/agents/{agent_id}", operationId: "updateAgentCredentialStatus" },
156158
"DELETE /v1/projects/{project_id}/agents/{agent_id}": { method: "DELETE", path: "/v1/projects/{project_id}/agents/{agent_id}", operationId: "revokeAgentCredential" },
159+
"POST /v1/projects/{project_id}/agents/{agent_id}/rotate": { method: "POST", path: "/v1/projects/{project_id}/agents/{agent_id}/rotate", operationId: "rotateAgentCredential" },
157160
"GET /v1/projects/{project_id}/anomalies": { method: "GET", path: "/v1/projects/{project_id}/anomalies", operationId: "listAnomalyAlerts" },
158161
"PATCH /v1/projects/{project_id}/anomalies/{anomaly_id}": { method: "PATCH", path: "/v1/projects/{project_id}/anomalies/{anomaly_id}", operationId: "updateAnomalyAlert" },
159162
"GET /v1/projects/{project_id}/approvals": { method: "GET", path: "/v1/projects/{project_id}/approvals", operationId: "listApprovalRequests" },
@@ -213,6 +216,7 @@ type CreateAgentCredentialParams = { pathParams: NonNullable<CreateAgentCredenti
213216
type GetAgentCredentialParams = { pathParams: NonNullable<GetAgentCredentialRequestConfig["pathParams"]> };
214217
type UpdateAgentCredentialStatusParams = { pathParams: NonNullable<UpdateAgentCredentialStatusRequestConfig["pathParams"]>; body: NonNullable<UpdateAgentCredentialStatusRequestConfig["data"]> };
215218
type RevokeAgentCredentialParams = { pathParams: NonNullable<RevokeAgentCredentialRequestConfig["pathParams"]> };
219+
type RotateAgentCredentialParams = { pathParams: NonNullable<RotateAgentCredentialRequestConfig["pathParams"]> };
216220
type ListAnomalyAlertsParams = { pathParams: NonNullable<ListAnomalyAlertsRequestConfig["pathParams"]>; queryParams?: NonNullable<ListAnomalyAlertsRequestConfig["queryParams"]> };
217221
type UpdateAnomalyAlertParams = { pathParams: NonNullable<UpdateAnomalyAlertRequestConfig["pathParams"]>; body: NonNullable<UpdateAnomalyAlertRequestConfig["data"]> };
218222
type ListApprovalRequestsParams = { pathParams: NonNullable<ListApprovalRequestsRequestConfig["pathParams"]>; queryParams?: NonNullable<ListApprovalRequestsRequestConfig["queryParams"]> };
@@ -275,6 +279,7 @@ export interface ApiOperations {
275279
getAgentCredential(params: GetAgentCredentialParams): Promise<GetAgentCredentialStatus200>;
276280
updateAgentCredentialStatus(params: UpdateAgentCredentialStatusParams): Promise<UpdateAgentCredentialStatusStatus200>;
277281
revokeAgentCredential(params: RevokeAgentCredentialParams): Promise<void>;
282+
rotateAgentCredential(params: RotateAgentCredentialParams): Promise<RotateAgentCredentialStatus200>;
278283
listAuditLogs(params: ListAuditLogsParams): Promise<ListAuditLogsStatus200>;
279284
};
280285
anomalies: {
@@ -355,6 +360,7 @@ export interface RequestMap {
355360
"GET /v1/projects/{project_id}/agents/{agent_id}": { params: GetAgentCredentialParams; response: GetAgentCredentialStatus200 };
356361
"PATCH /v1/projects/{project_id}/agents/{agent_id}": { params: UpdateAgentCredentialStatusParams; response: UpdateAgentCredentialStatusStatus200 };
357362
"DELETE /v1/projects/{project_id}/agents/{agent_id}": { params: RevokeAgentCredentialParams; response: void };
363+
"POST /v1/projects/{project_id}/agents/{agent_id}/rotate": { params: RotateAgentCredentialParams; response: RotateAgentCredentialStatus200 };
358364
"GET /v1/projects/{project_id}/anomalies": { params: ListAnomalyAlertsParams; response: ListAnomalyAlertsStatus200 };
359365
"PATCH /v1/projects/{project_id}/anomalies/{anomaly_id}": { params: UpdateAnomalyAlertParams; response: UpdateAnomalyAlertStatus200 };
360366
"GET /v1/projects/{project_id}/approvals": { params: ListApprovalRequestsParams; response: ListApprovalRequestsStatus200 };

src/generated/types/AgentCredentialSecrets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export type AgentCredentialSecrets = {
2222
*/
2323
connection_string: string;
2424
/**
25-
* @description Hosted MCP endpoint URL for this credential.
26-
* @example https://api.pgbeam.com/mcp
25+
* @description Hosted agent-database MCP endpoint. Paste into an MCP client (Claude Code, Cursor, …) with the mcp_token as a bearer token. The endpoint is token-scoped, so the same URL serves every credential.
26+
* @example https://mcp.pgbeam.app/mcp
2727
* @type string
2828
*/
2929
mcp_url: string;

src/generated/types/OnboardingProgress.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export type OnboardingProgress = {
4343
* @type boolean
4444
*/
4545
first_query_run: boolean;
46+
/**
47+
* @description Whether an agent credential has been issued.
48+
* @type boolean
49+
*/
50+
agent_credential_created: boolean;
4651
/**
4752
* @description Whether the user has dismissed the onboarding checklist.
4853
* @type boolean
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* Generated by Kubb (https://kubb.dev/).
3+
* Do not edit manually.
4+
*/
5+
6+
import type { AgentCredentialSecrets } from "./AgentCredentialSecrets";
7+
import type { Error } from "./Error";
8+
9+
/**
10+
* @description Unique project identifier (prefixed, e.g. prj_xxx).
11+
* @pattern ^[a-zA-Z0-9_.-]+$
12+
* @type string
13+
*/
14+
export type RotateAgentCredentialPathProjectId = string;
15+
16+
/**
17+
* @description Unique agent credential identifier (prefixed, e.g. agt_xxx).
18+
* @pattern ^[a-zA-Z0-9_.-]+$
19+
* @type string
20+
*/
21+
export type RotateAgentCredentialPathAgentId = string;
22+
23+
/**
24+
* @description One-time secrets returned only at creation. The connection string and MCP token are not retrievable again.
25+
* @type object
26+
*/
27+
export type RotateAgentCredentialStatus200 = AgentCredentialSecrets;
28+
29+
/**
30+
* @description Standard error response envelope for PgBeam API requests.
31+
* @type object
32+
*/
33+
export type RotateAgentCredentialStatus400 = Error;
34+
35+
/**
36+
* @description Standard error response envelope for PgBeam API requests.
37+
* @type object
38+
*/
39+
export type RotateAgentCredentialStatus401 = Error;
40+
41+
/**
42+
* @description Standard error response envelope for PgBeam API requests.
43+
* @type object
44+
*/
45+
export type RotateAgentCredentialStatus403 = Error;
46+
47+
/**
48+
* @description Standard error response envelope for PgBeam API requests.
49+
* @type object
50+
*/
51+
export type RotateAgentCredentialStatus404 = Error;
52+
53+
/**
54+
* @description Standard error response envelope for PgBeam API requests.
55+
* @type object
56+
*/
57+
export type RotateAgentCredentialStatus409 = Error;
58+
59+
/**
60+
* @type object
61+
*/
62+
export type RotateAgentCredentialRequestConfig = {
63+
data?: never;
64+
/**
65+
* @type object
66+
*/
67+
pathParams: {
68+
project_id: RotateAgentCredentialPathProjectId;
69+
agent_id: RotateAgentCredentialPathAgentId;
70+
};
71+
queryParams?: never;
72+
headerParams?: never;
73+
/**
74+
* @type string
75+
*/
76+
url: `/v1/projects/${string}/agents/${string}/rotate`;
77+
};
78+
79+
/**
80+
* @type object
81+
*/
82+
export type RotateAgentCredentialResponses = {
83+
"200": RotateAgentCredentialStatus200;
84+
"400": RotateAgentCredentialStatus400;
85+
"401": RotateAgentCredentialStatus401;
86+
"403": RotateAgentCredentialStatus403;
87+
"404": RotateAgentCredentialStatus404;
88+
"409": RotateAgentCredentialStatus409;
89+
};
90+
91+
/**
92+
* @description Union of all possible responses
93+
*/
94+
export type RotateAgentCredentialResponse = (RotateAgentCredentialStatus200 | RotateAgentCredentialStatus400 | RotateAgentCredentialStatus401 | RotateAgentCredentialStatus403 | RotateAgentCredentialStatus404 | RotateAgentCredentialStatus409);

src/generated/types/UpdateOnboardingRequest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export const updateOnboardingRequestStepEnum = {
88
database_added: "database_added",
99
connection_tested: "connection_tested",
1010
connection_string_copied: "connection_string_copied",
11-
first_query_run: "first_query_run"
11+
first_query_run: "first_query_run",
12+
agent_credential_created: "agent_credential_created"
1213
} as const;
1314

1415
export type UpdateOnboardingRequestStepEnumKey = (typeof updateOnboardingRequestStepEnum)[keyof typeof updateOnboardingRequestStepEnum];

src/generated/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export type { Region, RegionProviderEnumKey, RegionStatusEnumKey } from "./Regio
109109
export type { RejectApprovalRequestData, RejectApprovalRequestPathApprovalId, RejectApprovalRequestPathProjectId, RejectApprovalRequestRequestConfig, RejectApprovalRequestResponse, RejectApprovalRequestResponses, RejectApprovalRequestStatus200, RejectApprovalRequestStatus400, RejectApprovalRequestStatus401, RejectApprovalRequestStatus403, RejectApprovalRequestStatus404, RejectApprovalRequestStatus409 } from "./RejectApprovalRequest";
110110
export type { Replica } from "./Replica";
111111
export type { RevokeAgentCredentialPathAgentId, RevokeAgentCredentialPathProjectId, RevokeAgentCredentialRequestConfig, RevokeAgentCredentialResponse, RevokeAgentCredentialResponses, RevokeAgentCredentialStatus204, RevokeAgentCredentialStatus400, RevokeAgentCredentialStatus401, RevokeAgentCredentialStatus403, RevokeAgentCredentialStatus404 } from "./RevokeAgentCredential";
112+
export type { RotateAgentCredentialPathAgentId, RotateAgentCredentialPathProjectId, RotateAgentCredentialRequestConfig, RotateAgentCredentialResponse, RotateAgentCredentialResponses, RotateAgentCredentialStatus200, RotateAgentCredentialStatus400, RotateAgentCredentialStatus401, RotateAgentCredentialStatus403, RotateAgentCredentialStatus404, RotateAgentCredentialStatus409 } from "./RotateAgentCredential";
112113
export type { RowFilter } from "./RowFilter";
113114
export type { SSLModeKey } from "./SSLMode";
114115
export type { StatementRules } from "./StatementRules";

0 commit comments

Comments
 (0)