n4nAI

Topic

Function Calling in TypeScript/Node.js

13 posts on function calling in typescript/node.js — part of api integration on the n4n AI blog.

API integrationHow-to

Validating LLM tool arguments in TypeScript with Zod

Step-by-step guide to validating LLM tool arguments in TypeScript with Zod, covering schema design, runtime checks, and safe function calling.

4 min read
API integrationHow-to

TypeScript function calling: JSON Schema from types

Step-by-step guide to generating JSON Schema from TypeScript types for type-safe LLM function calling in Node.js, with runnable code and tests.

3 min read
API integrationHow-to

Testing tool-calling flows in TypeScript with Vitest

This hands-on guide to testing tool-calling flows in TypeScript with Vitest walks through unit, mock, and integration tests for building real LLM apps.

2 min read
API integrationHow-to

Streaming function calls in Node.js with async iterators

A practical guide to building streaming function calls nodejs async iterators pipelines with TypeScript, covering parsing, execution, and verification for LLM APIs.

3 min read
API integrationTutorial

Node.js function calling with Claude's Messages API

Hands-on tutorial for nodejs claude messages api function calling: build a TypeScript agent that invokes local tools via Anthropic's Messages API step by step.

1 min read
API integrationTutorial

Function calling with LangChain.js: a TypeScript tutorial

A hands-on TypeScript tutorial for langchainjs typescript function calling: define typed tools, bind to a chat model, and run the agent loop.

3 min read
API integrationTutorial

Function calling in Next.js API routes with GPT-4o

Step-by-step tutorial for implementing GPT-4o function calling inside Next.js API routes, with runnable TypeScript code and expected outputs.

2 min read
API integrationGuide

Error handling patterns for function calling in Node.js

Practical error handling patterns for function calling in Node.js: structured retries, validation, tool isolation, and graceful degradation for LLM apps.

4 min read
API integrationTutorial

Building an LLM tool-calling agent in TypeScript

Hands-on tutorial for building an LLM tool-calling agent in TypeScript: set up the OpenAI SDK, define JSON Schema tools, and run a ReAct loop with real code.

2 min read
API integrationTutorial

Building a multi-tool agent in TypeScript and Node.js

Hands-on tutorial to build a multi-tool agent in TypeScript and Node.js with function calling against OpenAI-compatible LLM endpoints, including runnable code.

2 min read
API integrationHow-to

Type-safe function calling in Node.js with Zod schemas

Build type-safe function calling in Node.js with Zod: convert schemas to JSON Schema, validate LLM tool calls, and run a reliable agent loop.

4 min read
API integrationTutorial

Function calling with TypeScript and the OpenAI SDK

A hands-on tutorial for implementing TypeScript OpenAI SDK function calling in Node.js, from tool schema definition to executing local functions.

3 min read
API integrationTutorial

Function calling with the Vercel AI SDK and n4n.ai

Hands-on tutorial for vercel ai sdk function calling n4n.ai: connect the OpenAI-compatible gateway to TypeScript tools with runnable code and output.

2 min read