Tu navegador
Comprobando…
Para conectar un agente real, usa un Chrome reciente y activa la opción «WebMCP for testing» en chrome://flags.
Agentes de IA
WebMCP es un nuevo estándar de los navegadores. Una página describe lo que puede hacer como herramientas, cada una con un nombre, una descripción y un esquema de entrada JSON. Un agente de IA en el navegador usa el sitio a través de esas herramientas en lugar de adivinar dónde hacer clic.
Comprobando…
Para conectar un agente real, usa un Chrome reciente y activa la opción «WebMCP for testing» en chrome://flags.
La página declara herramientas
Cada función registra sus herramientas en Angular. Las del buscaminas solo existen mientras el juego está en pantalla.
El navegador las muestra
El navegador muestra al agente las herramientas de la página abierta: nombres, descripciones y esquemas de entrada.
El agente llama a una herramienta
La herramienta llama al mismo servicio de Angular que los botones, así que la página cambia como si alguien hubiera hecho clic.
Llama a una herramienta como lo haría un agente. El juego de la derecha funciona en vivo, así que sus herramientas también están activas aquí.
Dificultad
Cada llamada a una herramienta en este sitio, de un agente de IA o de la zona de pruebas. Despliega una fila para ver el JSON.
Todas las herramientas que este sitio puede ofrecer y dónde están disponibles.
list_pages Activa ahora Solo lecturaLists the pages of this website, the article ids, the supported languages and the page that is open now.
Sin entrada
navigate_to_page Activa ahora Opens a page of this website in the current language. For a specific article pass page "articles" and its article id.
{
"type": "object",
"properties": {
"page": {
"type": "string",
"enum": [
"home",
"games",
"minesweeper",
"chess",
"mill",
"abalone",
"articles",
"joker",
"webmcp",
"contact",
"links"
],
"description": "Page to open."
},
"article": {
"type": "string",
"enum": [
"resource-sandbox",
"birds",
"r2r-vs-ros2"
],
"description": "Optional article id, only with page \"articles\"."
}
},
"required": [
"page"
]
}set_language Activa ahora Switches the website language and keeps the current page open.
{
"type": "object",
"properties": {
"language": {
"type": "string",
"enum": [
"pl",
"en",
"de",
"fr",
"es",
"it",
"pt",
"uk",
"no",
"sv",
"zh",
"ja",
"hi"
],
"description": "pl=Polish, en=English, de=German, fr=French, es=Spanish, it=Italian, pt=Portuguese (Brazil), uk=Ukrainian, no=Norwegian, sv=Swedish, zh=Chinese, ja=Japanese, hi=Hindi."
}
},
"required": [
"language"
]
}set_color_scheme Activa ahora Switches the website between the light and the dark color scheme.
{
"type": "object",
"properties": {
"scheme": {
"type": "string",
"enum": [
"light",
"dark"
]
}
},
"required": [
"scheme"
]
}set_seasonal_effect Activa ahora Sets the decorative animated overlay. "auto" picks one by date: snow in winter, butterflies in spring, halloween in October.
{
"type": "object",
"properties": {
"effect": {
"type": "string",
"enum": [
"auto",
"off",
"snow",
"butterflies",
"halloween"
]
}
},
"required": [
"effect"
]
}minesweeper_get_board Activa ahora Solo lecturaReturns the visible board, the game status and the counters. Hidden cells never reveal whether they hold a mine.
Sin entrada
minesweeper_reveal_cell Activa ahora Reveals a hidden cell, like a left click. Revealing a mine loses the game. Returns the updated board.
{
"type": "object",
"properties": {
"row": {
"type": "integer",
"minimum": 0,
"maximum": 23,
"description": "0-based row, top to bottom."
},
"col": {
"type": "integer",
"minimum": 0,
"maximum": 29,
"description": "0-based column, left to right."
}
},
"required": [
"row",
"col"
]
}minesweeper_toggle_flag Activa ahora Toggles a flag on a hidden cell, like a right click. Returns the updated board.
{
"type": "object",
"properties": {
"row": {
"type": "integer",
"minimum": 0,
"maximum": 23,
"description": "0-based row, top to bottom."
},
"col": {
"type": "integer",
"minimum": 0,
"maximum": 29,
"description": "0-based column, left to right."
}
},
"required": [
"row",
"col"
]
}minesweeper_new_game Activa ahora Con consecuenciasDiscards the current game and starts a new one. Optionally switches the difficulty: beginner (9×9, 10 mines), intermediate (16×16, 40 mines), expert (16 rows × 30 columns, 99 mines) or custom (the last custom size).
{
"type": "object",
"properties": {
"difficulty": {
"type": "string",
"enum": [
"beginner",
"intermediate",
"expert",
"custom"
]
}
}
}ask_joke_botSalida no fiableSends a message to the AI joke bot on this page. The message and the answer appear in the chat. Returns the joke.
{
"type": "object",
"properties": {
"topic": {
"type": "string",
"description": "Topic or message for the joke bot."
}
},
"required": [
"topic"
]
}Las herramientas son constantes simples que llaman a servicios de Angular. El registro las vincula al ciclo de vida de la app o de un componente.
Definir una herramienta
export const SET_COLOR_SCHEME = defineWebMcpTool({
name: 'set_color_scheme',
description: 'Switches the website between the light and the dark color scheme.',
inputSchema: {
type: 'object',
properties: { scheme: { type: 'string', enum: ['light', 'dark'] } },
required: ['scheme'],
},
execute: (input) => {
inject(ColorSchemeService).setScheme(input.scheme);
return `Color scheme set to ${input.scheme}.`;
},
});Registrar herramientas para todas las páginas
export const appConfig: ApplicationConfig = {
providers: [
provideWebMcpTools('site', SITE_WEBMCP_TOOLS),
],
};Registrar herramientas para un componente
export class MinesweeperComponent {
constructor() {
declareWebMcpTools('minesweeper', MINESWEEPER_WEBMCP_TOOLS);
}
}Pruébalo en la consola de DevTools
const tools = await document.modelContext.getTools();
tools.map((tool) => tool.name);
const reveal = tools.find((tool) => tool.name === 'minesweeper_reveal_cell');
await document.modelContext.executeTool(reveal, { row: 4, col: 4 });