Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Cheat sheet · Specialise

AI agents and MCP cheat sheet (TypeScript)

Opens with credits

For TypeScript developers who can already call a model API and want to build agents that hold up in real use: tool calling, Zod validation, memory, planning, LangGraph.js, the OpenAI Agents SDK, the Claude Agent SDK, MCP servers, evals and guardrails. Every snippet is TypeScript.

Curated by Tauseef Fayyaz10 chapters74 concepts128 glossary terms

Chapters

10 chapters · 74 concepts

  1. 1How agents workWhat makes a program an agent, the loop every agent runs, and how to decide whether a task needs an agent at all or a simpler workflow.6 concepts
  2. 2Tool calling from scratchHow a model asks your code to act: tool definitions, the call and result messages, tool choice, parallel calls and errors, shown with one provider API and no framework.8 concepts
  3. Structured output and validationGetting data your code can trust from a model: JSON Schema, strict modes, validation with Pydantic or Zod, and what to do when the output is wrong.6 conceptsOpens with credits
  4. Memory and stateWhat an agent remembers within one run and across runs: the context window, context engineering, compaction, long-term memory stores and explicit state.7 conceptsOpens with credits
  5. Planning and multi-agent patternsThe reusable shapes for multi-step work, from simple chains to orchestrators and handoffs, and when splitting work across several agents is worth the cost.8 conceptsOpens with credits
  6. Agent frameworksLangGraph, the OpenAI Agents SDK and the Claude Agent SDK: what each gives you over a hand-written loop, the core API of each, and how to choose.7 conceptsOpens with credits
  7. Building and publishing MCP serversThe Model Context Protocol from the server side: roles, primitives, transports, the stateless 2026-07-28 revision, the official SDKs, testing with the Inspector, auth and the registry.8 conceptsOpens with credits
  8. Evals and testing agentsHow to know an agent works before and after every change: tasks and trials, graders, trajectory checks, pass rates, model judges and a regression suite in CI.8 conceptsOpens with credits
  9. Guardrails, cost and safetyKeeping agents safe and affordable: prompt injection, the lethal trifecta, least privilege, human approval, sandboxes, step and budget limits, and the cost maths of a run.8 conceptsOpens with credits
  10. Observability and shippingRunning agents in production: tracing every step, OpenTelemetry conventions, durable execution, retries, streaming progress, model fallbacks and turning production traces into evals.8 conceptsOpens with credits
  11. 11Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.128 terms

About this sheet

Tool calling, MCP servers, evals.

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com