July 1, 2026

Function Calling from Angular — Structured JSON from LLMs (2026)

Updated — July 1, 2026 · Function calling / structured outputs from Angular to Spring AI tools.

Kindson Munonye · Software engineer & technical author
GitHub · LinkedIn · About · YouTube
Last updated by Kindson Munonye — July 1, 2026


📚 Tutorial hubs:
AI Developer Tutorials ·
Spring Boot ·
Angular ·
CRUD + REST guide

Source code: munonye-ai-chat-spring-angular on GitHub

Estimated reading time: 12–15 minutes · Last updated: July 1, 2026


This tutorial shows Angular function calling against a Spring AI backend with @Tool methods — part of AI Developer Tutorials.

Spring Boot tools

@Component
public class ProductTools {
  @Tool(description = "Look up product price by SKU")
  public ProductPrice getPrice(String sku) {
    return catalog.find(sku).map(p -> new ProductPrice(p.sku(), p.name(), p.price()))
        .orElse(new ProductPrice(sku, "Unknown", 0));
  }
}

public record ProductPrice(String sku, String name, double price) {}

Register tools when building ChatClient:

this.chatClient = builder
    .defaultTools(productTools)
    .build();

Angular display

interface ProductPrice {
  sku: string;
  name: string;
  price: number;
}

// In component after chat response:
parseProduct(json: string): ProductPrice | null {
  try { return JSON.parse(json); } catch { return null; }
}

Use @if blocks in the template to render a price card when the assistant returns JSON.

Related: Reactive forms validation for input validation before sending prompts.

Related:
AI Developer Tutorials hub ·
Angular CRUD Part 1 ·
Spring AI overview

Kindson Munonye

Kindson Munonye is a software engineer and technical author specializing in Angular, Spring Boot, and microservices architecture. He publishes step-by-step tutorials with source code covering CRUD operations, reactive forms, CQRS, event sourcing, and REST API integration.GitHub · LinkedIn · About · YouTube

View all posts by Kindson Munonye →
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted