File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,12 +283,12 @@ so returned values have to JSON-serializable.
283283** Parameters:**
284284
285285- ** function** (string) ** (required)** : A JavaScript function declaration to be executed by the tool in the currently selected page.
286- Example without arguments: `() => {
286+ Example without arguments: `() => {
287287 return document.title
288288}` or ` async () => {
289289 return await fetch("example.com")
290290}`.
291- Example with arguments: `(el) => {
291+ Example with arguments: `(el) => {
292292 return el.innerText;
293293}`
294294
Original file line number Diff line number Diff line change @@ -278,15 +278,15 @@ async function generateToolDocumentation(): Promise<void> {
278278 // Convert ToolDefinitions to ToolWithAnnotations
279279 const toolsWithAnnotations : ToolWithAnnotations [ ] = tools
280280 . filter ( tool => {
281- if ( ! tool . annotations . conditions ) {
282- return true ;
283- }
284-
285281 // Filter out extension tools
286282 if ( tool . name === 'install_extension' ) {
287283 return false ;
288284 }
289-
285+
286+ if ( ! tool . annotations . conditions ) {
287+ return true ;
288+ }
289+
290290 // Only include unconditional tools.
291291 return tool . annotations . conditions . length === 0 ;
292292 } )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export const installExtension = defineTool({
2222 . describe ( 'Absolute path to the unpacked extension folder.' ) ,
2323 } ,
2424 handler : async ( request , response , context ) => {
25- const { path } = request . params ;
25+ const { path} = request . params ;
2626 const id = await context . installExtension ( path ) ;
2727 response . appendResponseLine ( `Extension installed. Id: ${ id } ` ) ;
2828 } ,
Original file line number Diff line number Diff line change 66
77import assert from 'node:assert' ;
88import path from 'node:path' ;
9- import { describe , it } from 'node:test' ;
9+ import { describe , it } from 'node:test' ;
1010
11- import { installExtension } from '../../src/tools/extensions.js' ;
12- import { withMcpContext } from '../utils.js' ;
11+ import { installExtension } from '../../src/tools/extensions.js' ;
12+ import { withMcpContext } from '../utils.js' ;
1313
14- const EXTENSION_PATH = path . join ( import . meta. dirname , '../../../tests/tools/fixtures/extension' ) ;
14+ const EXTENSION_PATH = path . join (
15+ import . meta. dirname ,
16+ '../../../tests/tools/fixtures/extension' ,
17+ ) ;
1518
1619describe ( 'extension' , ( ) => {
1720 it ( 'installs an extension and verifies it is listed in chrome://extensions' , async ( ) => {
1821 await withMcpContext ( async ( response , context ) => {
1922 await installExtension . handler (
20- { params : { path : EXTENSION_PATH } } ,
23+ { params : { path : EXTENSION_PATH } } ,
2124 response ,
2225 context ,
2326 ) ;
Original file line number Diff line number Diff line change 1- <!DOCTYPE html> < html > < body > < h1 > Test Popup</ h1 > </ body > </ html >
1+ <!doctype html>
2+ < html
3+ > < body
4+ > < h1 > Test Popup</ h1 > </ body
5+ > </ html
6+ >
You can’t perform that action at this time.
0 commit comments