chore(mcp): opt descriptions

This commit is contained in:
Simon
2026-03-22 03:27:17 +08:00
parent 3456f45590
commit ce3047428a

View File

@@ -35,11 +35,14 @@ const mcpServer = new McpServer({ name: 'page-agent', version: '1.5.8' })
mcpServer.registerTool( mcpServer.registerTool(
'execute_task', 'execute_task',
{ {
description: description: "Execute a task in user's browser.",
'Execute a browser automation task described in natural language. ' + inputSchema: {
'The Page Agent extension will control the browser to complete the task. ' + task: z
'Blocks until the task is complete.', .string()
inputSchema: { task: z.string().describe('Task description in natural language') }, .describe(
'Task description. Give specific instructions for the task. Steps preferable. And the information you want to get after the task is done.'
),
},
}, },
async ({ task }) => { async ({ task }) => {
try { try {
@@ -50,7 +53,7 @@ mcpServer.registerTool(
{ {
type: 'text', type: 'text',
text: result.success text: result.success
? `Task completed successfully.\n\n${result.data}` ? `Task completed.\n\n${result.data}`
: `Task failed.\n\n${result.data}`, : `Task failed.\n\n${result.data}`,
}, },
], ],
@@ -67,7 +70,7 @@ mcpServer.registerTool(
mcpServer.registerTool( mcpServer.registerTool(
'get_status', 'get_status',
{ {
description: 'Check the current status of the Page Agent hub connection and agent.', description: 'Check the current status of the Page Agent hub.',
}, },
async () => ({ async () => ({
content: [ content: [