Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

823 B
Raw Blame
import { createAction } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';

export const getDailyPuzzle = createAction({
  name: 'get_daily_puzzle',
  classification: 'READ',
  displayName: 'Get Daily Puzzle',
  description: "Retrieve today's Chess.com daily puzzle.",
  audience: 'both',
  aiMetadata: {
    description:
      "Fetches the current Chess.com daily puzzle (title, board position/FEN, PGN, and puzzle image). Takes no input and always returns the puzzle for the current day. Read-only and idempotent within a given day.",
    idempotent: true,
  },
  props: {},
  async run() {
    const response = await httpClient.sendRequest({
      method: HttpMethod.GET,
      url: 'https://api.chess.com/pub/puzzle',
    });
    return response.body;
  },
});