@hubspot/cli 8.15.0-beta.2 → 8.15.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mcp-server/Tool.d.ts +3 -3
- package/mcp-server/Tool.js +3 -1
- package/mcp-server/tools/cms/HsCreateFunctionTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateModuleTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsCreateTemplateTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsFunctionLogsTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsListFunctionsTool.d.ts +2 -2
- package/mcp-server/tools/cms/HsListTool.d.ts +2 -2
- package/mcp-server/tools/project/AddFeatureToProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/AuthAccountTool.d.ts +2 -2
- package/mcp-server/tools/project/CreateProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/CreateTestAccountTool.d.ts +2 -2
- package/mcp-server/tools/project/DeployProjectTool.d.ts +2 -2
- package/mcp-server/tools/project/DocFetchTool.d.ts +2 -2
- package/mcp-server/tools/project/DocsSearchTool.d.ts +2 -2
- package/mcp-server/tools/project/FindProjectsTool.d.ts +2 -2
- package/mcp-server/tools/project/GetApiUsagePatternsByAppIdTool.d.ts +2 -2
- package/mcp-server/tools/project/GetApplicationInfoTool.d.ts +2 -2
- package/mcp-server/tools/project/GetBuildLogsTool.d.ts +2 -2
- package/mcp-server/tools/project/GetBuildStatusTool.d.ts +2 -2
- package/mcp-server/tools/project/GetConfigValuesTool.d.ts +2 -2
- package/mcp-server/tools/project/GuidedWalkthroughTool.d.ts +2 -2
- package/mcp-server/tools/project/UploadProjectTools.d.ts +2 -2
- package/mcp-server/tools/project/UploadProjectTools.js +7 -0
- package/mcp-server/tools/project/ValidateProjectTool.d.ts +2 -2
- package/mcp-server/types.d.ts +3 -1
- package/mcp-server/utils/content.d.ts +2 -2
- package/mcp-server/utils/content.js +1 -1
- package/mcp-server/utils/json.d.ts +3 -0
- package/mcp-server/utils/json.js +29 -0
- package/package.json +2 -2
package/mcp-server/Tool.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.
|
|
|
2
2
|
import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
3
3
|
import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import { McpLogger } from './utils/logger.js';
|
|
5
|
-
import {
|
|
5
|
+
import { McpToolResponse } from './types.js';
|
|
6
6
|
import { CommandResults, Command } from './utils/command.js';
|
|
7
7
|
export type ToolExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
|
|
8
8
|
export declare class Tool<InputSchema> {
|
|
@@ -11,10 +11,10 @@ export declare class Tool<InputSchema> {
|
|
|
11
11
|
protected toolName: string;
|
|
12
12
|
constructor(mcpServer: McpServer, logger: McpLogger, toolName: string);
|
|
13
13
|
register(): RegisteredTool;
|
|
14
|
-
handler(_input: InputSchema):
|
|
14
|
+
handler(_input: InputSchema): McpToolResponse | Promise<McpToolResponse>;
|
|
15
15
|
protected runCommand(directory: string, command: Command, extra?: ToolExtra): Promise<CommandResults>;
|
|
16
16
|
protected getTrackingMeta(_input: InputSchema): {
|
|
17
17
|
[key: string]: string;
|
|
18
18
|
} | undefined;
|
|
19
|
-
protected wrappedHandler(input: InputSchema, extra?: ToolExtra): Promise<
|
|
19
|
+
protected wrappedHandler(input: InputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
20
20
|
}
|
package/mcp-server/Tool.js
CHANGED
|
@@ -69,7 +69,9 @@ export class Tool {
|
|
|
69
69
|
error: error instanceof Error ? error.message : String(error),
|
|
70
70
|
durationMs: Date.now() - startTime,
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
const errorResponse = await formatTextContents(getErrorMessage(error));
|
|
73
|
+
errorResponse.isError = true;
|
|
74
|
+
return errorResponse;
|
|
73
75
|
}
|
|
74
76
|
finally {
|
|
75
77
|
this.logger.flushLogsToFile(this.toolName);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -20,7 +20,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
20
20
|
export type HsCreateFunctionInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
21
21
|
export declare class HsCreateFunctionTool extends Tool<HsCreateFunctionInputSchema> {
|
|
22
22
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
23
|
-
handler({ dest, functionsFolder, filename, endpointMethod, endpointPath, absoluteCurrentWorkingDirectory, }: HsCreateFunctionInputSchema, extra?: ToolExtra): Promise<
|
|
23
|
+
handler({ dest, functionsFolder, filename, endpointMethod, endpointPath, absoluteCurrentWorkingDirectory, }: HsCreateFunctionInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
24
24
|
register(): RegisteredTool;
|
|
25
25
|
}
|
|
26
26
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -16,7 +16,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
16
16
|
export type HsCreateModuleInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
17
17
|
export declare class HsCreateModuleTool extends Tool<HsCreateModuleInputSchema> {
|
|
18
18
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
19
|
-
handler({ userSuppliedName, dest, moduleLabel, reactType, contentTypes, global, availableForNewContent, absoluteCurrentWorkingDirectory, }: HsCreateModuleInputSchema, extra?: ToolExtra): Promise<
|
|
19
|
+
handler({ userSuppliedName, dest, moduleLabel, reactType, contentTypes, global, availableForNewContent, absoluteCurrentWorkingDirectory, }: HsCreateModuleInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
20
20
|
register(): RegisteredTool;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -21,7 +21,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
21
21
|
export type HsCreateTemplateInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
22
22
|
export declare class HsCreateTemplateTool extends Tool<HsCreateTemplateInputSchema> {
|
|
23
23
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
24
|
-
handler({ userSuppliedName, dest, templateType, absoluteCurrentWorkingDirectory, }: HsCreateTemplateInputSchema, extra?: ToolExtra): Promise<
|
|
24
|
+
handler({ userSuppliedName, dest, templateType, absoluteCurrentWorkingDirectory, }: HsCreateTemplateInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
25
25
|
register(): RegisteredTool;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -14,7 +14,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
14
14
|
export type HsFunctionLogsInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
15
15
|
export declare class HsFunctionLogsTool extends Tool<HsFunctionLogsInputSchema> {
|
|
16
16
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
17
|
-
handler({ endpoint, account, latest, compact, limit, absoluteCurrentWorkingDirectory, }: HsFunctionLogsInputSchema, extra?: ToolExtra): Promise<
|
|
17
|
+
handler({ endpoint, account, latest, compact, limit, absoluteCurrentWorkingDirectory, }: HsFunctionLogsInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
18
18
|
register(): RegisteredTool;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -11,7 +11,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
11
11
|
export type HsListFunctionsInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
12
12
|
export declare class HsListFunctionsTool extends Tool<HsListFunctionsInputSchema> {
|
|
13
13
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
14
|
-
handler({ account, json, absoluteCurrentWorkingDirectory, }: HsListFunctionsInputSchema, extra?: ToolExtra): Promise<
|
|
14
|
+
handler({ account, json, absoluteCurrentWorkingDirectory, }: HsListFunctionsInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
15
15
|
register(): RegisteredTool;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -11,7 +11,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
11
11
|
export type HsListInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
12
12
|
export declare class HsListTool extends Tool<HsListInputSchema> {
|
|
13
13
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
14
|
-
handler({ path, account, absoluteCurrentWorkingDirectory }: HsListInputSchema, extra?: ToolExtra): Promise<
|
|
14
|
+
handler({ path, account, absoluteCurrentWorkingDirectory }: HsListInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
15
15
|
register(): RegisteredTool;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -33,7 +33,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
33
33
|
export type AddFeatureInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
34
34
|
export declare class AddFeatureToProjectTool extends Tool<AddFeatureInputSchema> {
|
|
35
35
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
36
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, distribution, auth, features, addApp, }: AddFeatureInputSchema, extra?: ToolExtra): Promise<
|
|
36
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, distribution, auth, features, addApp, }: AddFeatureInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
37
37
|
register(): RegisteredTool;
|
|
38
38
|
}
|
|
39
39
|
export {};
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { McpLogger } from '../../utils/logger.js';
|
|
4
4
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
5
|
-
import {
|
|
5
|
+
import { McpToolResponse } from '../../types.js';
|
|
6
6
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
7
7
|
absoluteCurrentWorkingDirectory: z.ZodString;
|
|
8
8
|
accountId: z.ZodOptional<z.ZodNumber>;
|
|
@@ -12,7 +12,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
12
12
|
export type AuthAccountInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
13
13
|
export declare class AuthAccountTool extends Tool<AuthAccountInputSchema> {
|
|
14
14
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
15
|
-
handler({ absoluteCurrentWorkingDirectory, accountId, name, setAsDefault, }: AuthAccountInputSchema, extra?: ToolExtra): Promise<
|
|
15
|
+
handler({ absoluteCurrentWorkingDirectory, accountId, name, setAsDefault, }: AuthAccountInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
16
16
|
register(): RegisteredTool;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -37,7 +37,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
37
37
|
export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
38
38
|
export declare class CreateProjectTool extends Tool<CreateProjectInputSchema> {
|
|
39
39
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
40
|
-
handler({ name, destination, projectBase, distribution, auth, features, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema, extra?: ToolExtra): Promise<
|
|
40
|
+
handler({ name, destination, projectBase, distribution, auth, features, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
41
41
|
register(): RegisteredTool;
|
|
42
42
|
}
|
|
43
43
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { McpLogger } from '../../utils/logger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { McpToolResponse } from '../../types.js';
|
|
5
5
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
6
6
|
declare const createTestAccountInputSchema: z.ZodObject<{
|
|
7
7
|
absoluteCurrentWorkingDirectory: z.ZodString;
|
|
@@ -47,7 +47,7 @@ declare const createTestAccountInputSchema: z.ZodObject<{
|
|
|
47
47
|
export type CreateTestAccountInputSchema = z.infer<typeof createTestAccountInputSchema>;
|
|
48
48
|
export declare class CreateTestAccountTool extends Tool<CreateTestAccountInputSchema> {
|
|
49
49
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
50
|
-
handler({ absoluteCurrentWorkingDirectory, name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, commerceLevel, configPath, }: CreateTestAccountInputSchema, extra?: ToolExtra): Promise<
|
|
50
|
+
handler({ absoluteCurrentWorkingDirectory, name, description, marketingLevel, opsLevel, serviceLevel, salesLevel, contentLevel, commerceLevel, configPath, }: CreateTestAccountInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
51
51
|
register(): RegisteredTool;
|
|
52
52
|
}
|
|
53
53
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -11,7 +11,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
11
11
|
type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
|
|
12
12
|
export declare class DeployProjectTool extends Tool<InputSchemaType> {
|
|
13
13
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
14
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildNumber, }: InputSchemaType, extra?: ToolExtra): Promise<
|
|
14
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildNumber, }: InputSchemaType, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
15
15
|
register(): RegisteredTool;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { McpLogger } from '../../utils/logger.js';
|
|
3
3
|
import z from 'zod';
|
|
4
|
-
import {
|
|
4
|
+
import { McpToolResponse } from '../../types.js';
|
|
5
5
|
import { Tool } from '../../Tool.js';
|
|
6
6
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
7
7
|
docUrl: z.ZodString;
|
|
@@ -10,7 +10,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
10
10
|
type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
|
|
11
11
|
export declare class DocFetchTool extends Tool<InputSchemaType> {
|
|
12
12
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
13
|
-
handler({ docUrl, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<
|
|
13
|
+
handler({ docUrl, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<McpToolResponse>;
|
|
14
14
|
register(): RegisteredTool;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { McpLogger } from '../../utils/logger.js';
|
|
3
3
|
import z from 'zod';
|
|
4
|
-
import {
|
|
4
|
+
import { McpToolResponse } from '../../types.js';
|
|
5
5
|
import { Tool } from '../../Tool.js';
|
|
6
6
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
7
7
|
absoluteCurrentWorkingDirectory: z.ZodString;
|
|
@@ -23,7 +23,7 @@ export declare class DocsSearchTool extends Tool<InputSchemaType> {
|
|
|
23
23
|
protected getTrackingMeta({ docsSearchQuery, }: InputSchemaType): {
|
|
24
24
|
[key: string]: string;
|
|
25
25
|
} | undefined;
|
|
26
|
-
handler({ docsSearchQuery, docsSearchLimit, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<
|
|
26
|
+
handler({ docsSearchQuery, docsSearchLimit, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<McpToolResponse>;
|
|
27
27
|
register(): RegisteredTool;
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -9,7 +9,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
9
9
|
export type FindProjectsInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
10
10
|
export declare class FindProjectsTool extends Tool<FindProjectsInputSchema> {
|
|
11
11
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
12
|
-
handler({ absoluteDirectory, }: FindProjectsInputSchema): Promise<
|
|
12
|
+
handler({ absoluteDirectory, }: FindProjectsInputSchema): Promise<McpToolResponse>;
|
|
13
13
|
register(): RegisteredTool;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -13,7 +13,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
13
13
|
export type GetApiUsagePatternsByAppIdInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
14
14
|
export declare class GetApiUsagePatternsByAppIdTool extends Tool<GetApiUsagePatternsByAppIdInputSchema> {
|
|
15
15
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
16
|
-
handler({ appId, startDate, endDate, absoluteCurrentWorkingDirectory, absoluteProjectPath, }: GetApiUsagePatternsByAppIdInputSchema): Promise<
|
|
16
|
+
handler({ appId, startDate, endDate, absoluteCurrentWorkingDirectory, absoluteProjectPath, }: GetApiUsagePatternsByAppIdInputSchema): Promise<McpToolResponse>;
|
|
17
17
|
register(): RegisteredTool;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -10,7 +10,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
10
10
|
export type GetApplicationInfoInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
11
11
|
export declare class GetApplicationInfoTool extends Tool<GetApplicationInfoInputSchema> {
|
|
12
12
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
13
|
-
handler({ absoluteCurrentWorkingDirectory, absoluteProjectPath, }: GetApplicationInfoInputSchema): Promise<
|
|
13
|
+
handler({ absoluteCurrentWorkingDirectory, absoluteProjectPath, }: GetApplicationInfoInputSchema): Promise<McpToolResponse>;
|
|
14
14
|
register(): RegisteredTool;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -17,7 +17,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
17
17
|
export type GetBuildLogsInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
18
18
|
export declare class GetBuildLogsTool extends Tool<GetBuildLogsInputSchema> {
|
|
19
19
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
20
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildId, logLevel, }: GetBuildLogsInputSchema): Promise<
|
|
20
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildId, logLevel, }: GetBuildLogsInputSchema): Promise<McpToolResponse>;
|
|
21
21
|
register(): RegisteredTool;
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -12,7 +12,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
12
12
|
export type GetBuildStatusInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
13
13
|
export declare class GetBuildStatusTool extends Tool<GetBuildStatusInputSchema> {
|
|
14
14
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
15
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildId, limit, }: GetBuildStatusInputSchema): Promise<
|
|
15
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, buildId, limit, }: GetBuildStatusInputSchema): Promise<McpToolResponse>;
|
|
16
16
|
register(): RegisteredTool;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -12,7 +12,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
12
12
|
type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
|
|
13
13
|
export declare class GetConfigValuesTool extends Tool<InputSchemaType> {
|
|
14
14
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
15
|
-
handler({ platformVersion, featureType, absoluteCurrentWorkingDirectory, absoluteProjectPath, }: InputSchemaType): Promise<
|
|
15
|
+
handler({ platformVersion, featureType, absoluteCurrentWorkingDirectory, absoluteProjectPath, }: InputSchemaType): Promise<McpToolResponse>;
|
|
16
16
|
register(): RegisteredTool;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -15,7 +15,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
15
15
|
type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
|
|
16
16
|
export declare class GuidedWalkthroughTool extends Tool<InputSchemaType> {
|
|
17
17
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
18
|
-
handler({ command, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<
|
|
18
|
+
handler({ command, absoluteCurrentWorkingDirectory, }: InputSchemaType): Promise<McpToolResponse>;
|
|
19
19
|
register(): RegisteredTool;
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { McpLogger } from '../../utils/logger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { McpToolResponse } from '../../types.js';
|
|
5
5
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
6
6
|
declare const inputSchemaZodObject: z.ZodObject<{
|
|
7
7
|
absoluteProjectPath: z.ZodString;
|
|
@@ -12,7 +12,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
12
12
|
type InputSchemaType = z.infer<typeof inputSchemaZodObject>;
|
|
13
13
|
export declare class UploadProjectTools extends Tool<InputSchemaType> {
|
|
14
14
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
15
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, profile, uploadMessage, }: InputSchemaType, extra?: ToolExtra): Promise<
|
|
15
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, profile, uploadMessage, }: InputSchemaType, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
16
16
|
register(): RegisteredTool;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -7,6 +7,8 @@ import { absoluteCurrentWorkingDirectory, absoluteProjectPath, } from './constan
|
|
|
7
7
|
import { formatTextContent, formatTextContents } from '../../utils/content.js';
|
|
8
8
|
import { HubSpotCommand } from '../../utils/command.js';
|
|
9
9
|
import { setupHubSpotConfig } from '../../utils/config.js';
|
|
10
|
+
import { parseCommandJsonOutput } from '../../utils/json.js';
|
|
11
|
+
import { UploadSchema } from '../../../lib/jsonOutput/upload.js';
|
|
10
12
|
const inputSchema = {
|
|
11
13
|
absoluteProjectPath,
|
|
12
14
|
absoluteCurrentWorkingDirectory,
|
|
@@ -30,6 +32,7 @@ export class UploadProjectTools extends Tool {
|
|
|
30
32
|
setupHubSpotConfig(absoluteCurrentWorkingDirectory);
|
|
31
33
|
const command = new HubSpotCommand('project upload', [
|
|
32
34
|
{ name: 'force', value: true },
|
|
35
|
+
{ name: 'json', value: true },
|
|
33
36
|
]);
|
|
34
37
|
const content = [];
|
|
35
38
|
if (uploadMessage) {
|
|
@@ -60,12 +63,15 @@ export class UploadProjectTools extends Tool {
|
|
|
60
63
|
if (content.length > 0) {
|
|
61
64
|
return {
|
|
62
65
|
content,
|
|
66
|
+
structuredContent: {},
|
|
63
67
|
};
|
|
64
68
|
}
|
|
65
69
|
const { stdout, stderr } = await this.runCommand(absoluteProjectPath, command, extra);
|
|
66
70
|
const response = await formatTextContents(stdout, stderr);
|
|
67
71
|
// Add reminder about cards needing to be added to views
|
|
68
72
|
response.content.push(formatTextContent('\nIMPORTANT: If this project contains cards, remember that uploading does NOT make them live automatically. Cards must be manually added to a view in HubSpot to become visible to users.'));
|
|
73
|
+
response.structuredContent =
|
|
74
|
+
parseCommandJsonOutput(stdout, UploadSchema, this.logger, toolName) ?? {};
|
|
69
75
|
return response;
|
|
70
76
|
}
|
|
71
77
|
register() {
|
|
@@ -73,6 +79,7 @@ export class UploadProjectTools extends Tool {
|
|
|
73
79
|
title: 'Upload HubSpot Project',
|
|
74
80
|
description: 'DO NOT run this tool unless the user specifies they would like to upload the project, it is potentially destructive. Uploads the HubSpot project in current working directory. If the project does not exist, it will be created. MUST be ran from within the project directory. IMPORTANT: Uploading a project does NOT automatically make cards live or visible to users. Cards must be manually added to a view in HubSpot after upload to become visible. If you do not know the project path, use the find-projects tool first to locate HubSpot projects in the workspace.',
|
|
75
81
|
inputSchema,
|
|
82
|
+
outputSchema: UploadSchema.shape,
|
|
76
83
|
annotations: {
|
|
77
84
|
readOnlyHint: false,
|
|
78
85
|
destructiveHint: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { McpToolResponse } from '../../types.js';
|
|
2
2
|
import { Tool, ToolExtra } from '../../Tool.js';
|
|
3
3
|
import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
import { McpLogger } from '../../utils/logger.js';
|
|
@@ -10,7 +10,7 @@ declare const inputSchemaZodObject: z.ZodObject<{
|
|
|
10
10
|
export type CreateProjectInputSchema = z.infer<typeof inputSchemaZodObject>;
|
|
11
11
|
export declare class ValidateProjectTool extends Tool<CreateProjectInputSchema> {
|
|
12
12
|
constructor(mcpServer: McpServer, logger: McpLogger);
|
|
13
|
-
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema, extra?: ToolExtra): Promise<
|
|
13
|
+
handler({ absoluteProjectPath, absoluteCurrentWorkingDirectory, }: CreateProjectInputSchema, extra?: ToolExtra): Promise<McpToolResponse>;
|
|
14
14
|
register(): RegisteredTool;
|
|
15
15
|
}
|
|
16
16
|
export {};
|
package/mcp-server/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TextContent,
|
|
2
|
-
export declare function formatTextContents(...outputs: (string | undefined)[]): Promise<
|
|
1
|
+
import { TextContent, McpToolResponse } from '../types.js';
|
|
2
|
+
export declare function formatTextContents(...outputs: (string | undefined)[]): Promise<McpToolResponse>;
|
|
3
3
|
export declare function formatTextContent(text: string): TextContent;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getErrorMessage } from '../../lib/errorHandlers/index.js';
|
|
3
|
+
// Parses the stdout of a `hs ... --json` command and validates it against the
|
|
4
|
+
// provided schema. Returns the inferred type on success, or null if the output
|
|
5
|
+
// is not valid JSON or fails schema validation. Adopter tools use the returned
|
|
6
|
+
// object as the structuredContent of their response.
|
|
7
|
+
export function parseCommandJsonOutput(stdout, schema, logger, context) {
|
|
8
|
+
const loggerContext = context ?? 'parseCommandJsonOutput';
|
|
9
|
+
let parsed;
|
|
10
|
+
try {
|
|
11
|
+
parsed = JSON.parse(stdout);
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
logger?.debug(loggerContext, {
|
|
15
|
+
message: 'Failed to parse JSON output',
|
|
16
|
+
error: getErrorMessage(e),
|
|
17
|
+
});
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const result = schema.safeParse(parsed);
|
|
21
|
+
if (!result.success) {
|
|
22
|
+
logger?.debug(loggerContext, {
|
|
23
|
+
message: 'JSON output failed schema validation',
|
|
24
|
+
error: z.flattenError(result.error),
|
|
25
|
+
});
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return result.data;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "8.15.0-beta.
|
|
3
|
+
"version": "8.15.0-beta.3",
|
|
4
4
|
"description": "The official CLI for developing on HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/HubSpot/hubspot-cli",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@hubspot/local-dev-lib": "5.11.0",
|
|
14
14
|
"@hubspot/project-parsing-lib": "0.23.3",
|
|
15
|
-
"@hubspot/ui-extensions-dev-server": "2.
|
|
15
|
+
"@hubspot/ui-extensions-dev-server": "2.2.2",
|
|
16
16
|
"@inquirer/prompts": "7.1.0",
|
|
17
17
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
18
18
|
"archiver": "7.0.1",
|