Skip to main content
Glama

getYesOrNo

Answer yes-or-no questions by analyzing input queries to provide binary responses for decision-making scenarios.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYes

Implementation Reference

  • The handler function for the 'getYesOrNo' tool. It takes a 'question' parameter and randomly returns either 'YES' or 'NO' as text content.
    async ({ question }) => { return { content: [ { type: "text", text: Math.random() > 0.5 ? "YES" : "NO", }, ], }; },
  • Input schema for the 'getYesOrNo' tool, defining a required 'question' string parameter.
    { question: z.string(), },
  • stdio-example.ts:10-25 (registration)
    Registration of the 'getYesOrNo' tool using server.tool(), including schema and inline handler.
    server.tool( "getYesOrNo", { question: z.string(), }, async ({ question }) => { return { content: [ { type: "text", text: Math.random() > 0.5 ? "YES" : "NO", }, ], }; }, );

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/a-polishchuk/mcp-example-stdio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server