Remove obsolete tool: HelloWorldTool

This commit is contained in:
Dominik Jain 2025-10-11 22:02:20 +02:00
parent 5136c84534
commit 4cbce1e009
3 changed files with 2 additions and 62 deletions

View File

@ -12,11 +12,11 @@
- **Declaration Files**: Generated with source maps
## Naming Conventions
- **Classes**: PascalCase (e.g., `HelloWorldTool`, `PenpotMcpServer`)
- **Classes**: PascalCase (e.g., `ExeceuteCodeTool`, `PenpotMcpServer`)
- **Interfaces**: PascalCase (e.g., `Tool`)
- **Methods**: camelCase (e.g., `execute`, `registerTools`)
- **Constants**: camelCase for readonly properties (e.g., `definition`)
- **Files**: PascalCase for classes (e.g., `HelloWorldTool.ts`)
- **Files**: PascalCase for classes (e.g., `ExecuteCodeTool.ts`)
## Documentation Style
- **JSDoc**: Use comprehensive JSDoc comments for classes, methods, and interfaces

View File

@ -1,8 +1,6 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { HelloWorldTool } from "./tools/HelloWorldTool";
import { PrintTextTool } from "./tools/PrintTextTool";
import { ExecuteCodeTool } from "./tools/ExecuteCodeTool";
import { PluginBridge } from "./PluginBridge";
@ -63,7 +61,6 @@ export class PenpotMcpServer {
private registerTools(): void {
const toolInstances: Tool<any>[] = [
new HelloWorldTool(this),
new PrintTextTool(this),
new ExecuteCodeTool(this),
new HighLevelOverviewTool(this),

View File

@ -1,57 +0,0 @@
import { z } from "zod";
import { Tool } from "../Tool";
import "reflect-metadata";
import type { ToolResponse } from "../ToolResponse";
import { TextResponse } from "../ToolResponse";
import { PenpotMcpServer } from "../PenpotMcpServer";
/**
* Arguments class for the HelloWorld tool with validation decorators.
*/
export class HelloWorldArgs {
static schema = {
name: z.string(),
};
/**
* The name to include in the greeting message.
*/
name!: string;
}
/**
* Type-safe HelloWorld tool with automatic validation and schema generation.
*
* This tool directly implements the Tool interface while maintaining full
* type safety through the protected executeTypeSafe method.
*/
export class HelloWorldTool extends Tool<HelloWorldArgs> {
/**
* @param mcpServer - The MCP server instance
*/
constructor(mcpServer: PenpotMcpServer) {
super(mcpServer, HelloWorldArgs.schema);
}
public getToolName(): string {
return "hello_world";
}
public getToolDescription(): string {
return "Returns a personalized greeting message with the provided name";
}
/**
* Executes the hello world functionality with type-safe, validated arguments.
*
* This method receives fully validated arguments with complete type safety.
* No casting or manual validation is required.
*
* @param args - The validated HelloWorldArgs instance
*/
protected async executeCore(args: HelloWorldArgs): Promise<ToolResponse> {
return new TextResponse(
`Hello, ${args.name}! This greeting was generated with full type safety and automatic validation.`
);
}
}