penpot/mcp/packages/server/src/tools/HighLevelOverviewTool.ts
Dr. Dominik Jain 757fb8e21d Reduce instructions transferred at MCP connection to a minimum (#8649)
*  Reduce instructions transferred at MCP connection to a minimum

Force on-demand loading of the 'Penpot High-Level Overview',
which was previously transferred in the MCP server's instructions.

This greatly reduces the number of tokens for users who will
not actually interact with Penpot, allowing the MCP server to
remain enabled for such users without wasting too many tokens.

Resolves #8647

* 📎 Update Serena project
2026-03-17 18:50:07 +01:00

27 lines
937 B
TypeScript

import { EmptyToolArgs, Tool } from "../Tool";
import "reflect-metadata";
import type { ToolResponse } from "../ToolResponse";
import { TextResponse } from "../ToolResponse";
import { PenpotMcpServer } from "../PenpotMcpServer";
export class HighLevelOverviewTool extends Tool<EmptyToolArgs> {
constructor(mcpServer: PenpotMcpServer) {
super(mcpServer, EmptyToolArgs.schema);
}
public getToolName(): string {
return "high_level_overview";
}
public getToolDescription(): string {
return (
"Returns basic high-level instructions on the usage of Penpot-related tools and the Penpot API. " +
"If you have already read the 'Penpot High-Level Overview', you must not call this tool."
);
}
protected async executeCore(args: EmptyToolArgs): Promise<ToolResponse> {
return new TextResponse(this.mcpServer.getHighLevelOverviewInstructions());
}
}