Tomasz Czajka

Agentes de IA

WebMCP: este site conversa com agentes de IA

WebMCP é um novo padrão de navegador. Uma página web descreve o que sabe fazer na forma de ferramentas, cada uma com nome, descrição e um schema de entrada em JSON. Um agente de IA no navegador então usa o site por meio dessas ferramentas, em vez de adivinhar onde clicar.

Seu navegador

Verificando…

Para conectar um agente de verdade, use um Chrome recente e ative a flag "WebMCP for testing" em chrome://flags.

Como funciona

  1. 1

    A página declara ferramentas

    Cada funcionalidade registra suas ferramentas no Angular. As ferramentas do Campo minado só existem enquanto o jogo está na tela.

  2. 2

    O navegador as lista

    O navegador mostra ao agente as ferramentas da página aberta: nomes, descrições e schemas de entrada.

  3. 3

    O agente chama uma ferramenta

    A ferramenta chama o mesmo serviço Angular que os botões, então a página se atualiza como se uma pessoa tivesse clicado.

Playground

Chame uma ferramenta como um agente faria. O jogo à direita está rodando, então as ferramentas dele também estão ativas nesta página.

Campo minado

Dificuldade

Bombas restantes 10
Bandeiras colocadas 0
Pontuação 0
Progresso 0 / 71
Clique com o botão esquerdo para revelar uma casa. Clique com o direito para colocar uma bandeira.

Log de atividades

Todas as chamadas de ferramentas neste site, vindas de um agente de IA ou do playground. Expanda uma linha para ver o JSON.

  • Nenhuma chamada ainda. Execute uma ferramenta no playground ou deixe um agente jogar.

Catálogo de ferramentas

Todas as ferramentas que este site pode expor e onde cada uma está disponível.

Todas as páginas

list_pages Ativa agora Somente leitura

Lists the pages of this website, the article ids, the supported languages and the page that is open now.

Sem entrada

navigate_to_page Ativa agora

Opens a page of this website in the current language. For a specific article pass page "articles" and its article id.

Schema de entrada
{
  "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 Ativa agora

Switches the website language and keeps the current page open.

Schema de entrada
{
  "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 Ativa agora

Switches the website between the light and the dark color scheme.

Schema de entrada
{
  "type": "object",
  "properties": {
    "scheme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ]
    }
  },
  "required": [
    "scheme"
  ]
}
set_seasonal_effect Ativa agora

Sets the decorative animated overlay. "auto" picks one by date: snow in winter, butterflies in spring, halloween in October.

Schema de entrada
{
  "type": "object",
  "properties": {
    "effect": {
      "type": "string",
      "enum": [
        "auto",
        "off",
        "snow",
        "butterflies",
        "halloween"
      ]
    }
  },
  "required": [
    "effect"
  ]
}

Página do Campo minado

Abrir página
minesweeper_get_board Ativa agora Somente leitura

Returns the visible board, the game status and the counters. Hidden cells never reveal whether they hold a mine.

Sem entrada

minesweeper_reveal_cell Ativa agora

Reveals a hidden cell, like a left click. Revealing a mine loses the game. Returns the updated board.

Schema de entrada
{
  "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 Ativa agora

Toggles a flag on a hidden cell, like a right click. Returns the updated board.

Schema de entrada
{
  "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 Ativa agora Com efeitos

Discards 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).

Schema de entrada
{
  "type": "object",
  "properties": {
    "difficulty": {
      "type": "string",
      "enum": [
        "beginner",
        "intermediate",
        "expert",
        "custom"
      ]
    }
  }
}

Página do Bot de piadas

Abrir página
ask_joke_botSaída não confiável

Sends a message to the AI joke bot on this page. The message and the answer appear in the chat. Returns the joke.

Schema de entrada
{
  "type": "object",
  "properties": {
    "topic": {
      "type": "string",
      "description": "Topic or message for the joke bot."
    }
  },
  "required": [
    "topic"
  ]
}

Para desenvolvedores

As ferramentas são constantes simples que chamam serviços Angular. O registro as vincula ao ciclo de vida do app ou de um componente.

Defina uma ferramenta

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}.`;
  },
});

Registre ferramentas para todas as páginas

export const appConfig: ApplicationConfig = {
  providers: [
    provideWebMcpTools('site', SITE_WEBMCP_TOOLS),
  ],
};

Registre ferramentas para um componente

export class MinesweeperComponent {
  constructor() {
    declareWebMcpTools('minesweeper', MINESWEEPER_WEBMCP_TOOLS);
  }
}

Experimente no console do 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 });