Kick off your book project in 2 hours, get started with GhostAI in 2 hours, or do both! Free live workshops, on Zoom. You’ll leave with a real book project and a clear plan to keep going. Saturday, June 27, 2026.

Leanpub Header

Skip to main content

Building Pragmatic AI Agents That Use Tools and APIs

Building Systems That Use Tools and APIs with DSPy, Pydantic AI, Claude SDK, OpenAI Agents SDK, and Google ADK

Most AI systems can talk, but very few can actually do. This book is about closing that gap. Building Pragmatic AI Agents That Use Tools and APIs takes you beyond prompt tricks and prototype demos into the real engineering challenge of making models reliably call tools, orchestrate workflows, and interact with external systems under constraints like latency, failure, and evolving APIs.

Through practical side-by-side implementations using DSPy, Pydantic AI, the Claude Agent SDK, the OpenAI Agents SDK, and Google ADK, you’ll see how different design philosophies approach the same hard problems: planning, tool selection, state management, and safety.

The result is not another conceptual overview of “agentic AI,” but a grounded guide to building systems that behave predictably when they run into the messy reality of production environments.

Minimum price

$25.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
About

About

About the Book

AI agents are everywhere, or at least everyone claims they are. But building an agent that reliably uses external tools, APIs, and databases to complete real tasks is a fundamentally different engineering challenge than writing prompts or fine-tuning models. This book bridges the gap between hype and reality. It walks you through five production-grade frameworks (DSPy, Pydantic AI, Claude Agent SDK, OpenAI Agents SDK, Google ADK), showing how each one approaches tool use, orchestration, and safety with runnable code examples, architectural comparisons, and hard-won lessons from teams deploying agents at scale.

Forward-Looking Disclaimer: This book was written with the agent framework landscape as it exists in mid-2026. Model versions, pricing tiers, API surfaces, and feature availability change rapidly. Where this manuscript references specific model names (for example, “GPT-5” or “Claude Sonnet 4”), these are illustrative projections based on publicly announced roadmaps and should be treated as such. All framework documentation URLs and code examples have been verified against live sources at the time of writing, but API surfaces may evolve. The engineering principles, patterns, and trade-off analyses presented here remain valid regardless of which specific model versions or framework releases you are using.

On “War Stories” and Illustrative Scenarios: Throughout this book, you will encounter anecdotes framed as consulting experiences. These are composite scenarios built from documented production issues, community forums, and engineering postmortems across the agent ecosystem. They are intended for pedagogical illustration to demonstrate real failure modes and debugging patterns rather than as specific verifiable case studies of named organizations. The underlying technical lessons, however, reflect genuine production challenges that teams face when deploying agents at scale.

Share this book

Author

About the Author

Steve T.

Steve T. is an experienced IT and cybersecurity professional with more than 20 years of hands-on expertise spanning application security, infrastructure security, and vulnerability management. Having started his career during the early evolution of modern web technologies, he has witnessed firsthand the transformation of enterprise systems, software development practices, and the cybersecurity landscape.

His technical background covers a broad range of disciplines, including web application security, penetration testing, security architecture reviews, secure software development, incident response, and vulnerability research. With extensive experience analyzing complex systems at both the application and operating system levels, Steve combines deep technical knowledge with a practical understanding of real-world business and security challenges.

Throughout his career, he has worked across multiple industries, helping organizations identify, assess, and remediate security risks in critical environments. His approach emphasizes pragmatic security, balancing robust protection with operational and business requirements. Through continuous engagement with emerging technologies and evolving threats, Steve remains committed to advancing secure and resilient IT environments.

Contents

Table of Contents

Building Systems That Use Tools and APIs with DSPy, Pydantic AI, Claude SDK, OpenAI Agents SDK, and Google ADK

  1. A Unified Guide to DSPy, OpenAI Agents SDK, Claude Agent SDK, Google ADK, and Beyond
  2. Introduction: The Agent Revolution: Why Tools Change Everything
  3. Chapter 1: The Anatomy of an AI Agent
  4. Chapter 2: Designing Tools That Agents Can Use Well
  5. Chapter 3: DSPy: Programming LLM Pipelines, Not Prompts
  6. Chapter 4: Pydantic AI: Type-Safe Agents the Python Way
  7. Chapter 5: Claude Agent SDK: In-Process Tools and Built-in Execution
  8. Chapter 6: OpenAI Agents SDK: Lightweight Orchestration with Handoffs
  9. Chapter 7: Google ADK: Graph-Based Workflows for Enterprise Scale
  10. Chapter 8: Cross-Framework Patterns: What Works Everywhere
  11. Chapter 9: Productionizing Agent Systems
  12. Chapter 10: The Future of Agent Tool Use
  13. Conclusion: Choosing Your Path
  14. Glossary of Key Terms
  15. Index
  16. References

Framework Documentation

  1. DSPy (Declarative Self-improving Python)
  2. Pydantic AI
  3. Claude Agent SDK
  4. OpenAI Agents SDK
  5. Google ADK (Agent Development Kit)
  6. MCP Ecosystem

Academic Papers

  1. MCP Ecosystem

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub