CodeGym
AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • How GPT decides to call a tool: the tool-call model and the role of descriptions

    ChatGPT Apps
    Level 4, Lesson 0
    In this lecture, we examine the “brain” of ChatGPT Apps: how the model chooses between a regular text reply and a tool call ( tool-call), what exactly it sees (system prompt, the list of tools, the conversation history), why name/ description/ inputSchema are critical, what a call looks like at the API level ( tool_calls, finish_reason), and how permissions/annotations ( readOnly, destructive) influence model behavior and UX.
    Available
  • Describing tools: JSON Schema, typing, annotations

    ChatGPT Apps
    Level 4, Lesson 1
    In this lecture, we cover how to describe tools in MCP and ChatGPT Apps using JSON Schema: how inputSchema is structured, why it is part of the model’s “prompt,” how to write a good description, when to use enum and constraints ( minItems, format). Then we build a “single source of truth” in TypeScript via Zod + zod-to-json-schema, discuss issues with optional fields, and show the role of _meta/annotations (for example, readOnlyHint, destructiveHint, openai/outputTemplate) for UX and safety.
    Available
  • Server-side implementation of tools: from call to response

    ChatGPT Apps
    Level 4, Lesson 2
    We walk through the server path of tool invocations in the Apps SDK + MCP ecosystem: how ChatGPT calls a tool via JSON-RPC, where the MCP server lives in the Next.js template ( app/mcp/route.ts), how to design the inputSchema and return the result via content and structuredContent, how to bind the UI through _meta and openai/outputTemplate, as well as how to do validation, authorization, work with external APIs, logging, and error handling.
    Available
  • Handling tool results in the widget: ToolOutput → UI

    ChatGPT Apps
    Level 4, Lesson 3
    We break down the full data path from the server tool to the React UI in ChatGPT Apps: how ToolOutput arrives in the widget via the Apps SDK, how structuredContent, content, and _meta differ, how to safely read toolOutput via hooks ( useWidgetProps) instead of directly accessing window, and how to build UI states (loading/empty/error) around the tool call result.
    Available
  • Errors, idempotency, and designing “safe” tools

    ChatGPT Apps
    Level 4, Lesson 4
    In this lecture, we discuss why in ChatGPT Apps the same tool can be invoked more than once (retries, Regenerate, network glitches), how to design idempotent operations via idempotency_key, how to return errors so that both the model and the UI understand them consistently ( ok/ error, code, retryable), and how to safely configure a widget via text/html+skybridge and _meta (CSP, domain, visual flags).
    Available
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym