# Tool Call Rendering

> Render a frontend or backend tool call in Angular chat with a standalone component.

## Render a tool result [#render-a-tool-result]

A renderer is a standalone component with a required `toolCall` signal input.
Its status moves through `"in-progress"`, `"executing"`, and `"complete"`.

```ts title="src/app/weather-card.component.ts"
import { Component, input } from "@angular/core";
import {
  type AngularToolCall,
  type ToolRenderer,
} from "@copilotkit/angular";

type WeatherArgs = { city: string };

@Component({
  selector: "app-weather-card",
  template: `
    @let call = toolCall();
    @if (call.status === "complete") {
      <article>
        <strong>{{ call.args.city }}</strong>
        <p>{{ call.result }}</p>
      </article>
    } @else {
      <p>Loading weather for {{ call.args.city ?? "…" }}</p>
    }
  `,
})
export class WeatherCardComponent implements ToolRenderer<WeatherArgs> {
  readonly toolCall = input.required<AngularToolCall<WeatherArgs>>();
}
```

Pass the class as `component` when the tool runs in the browser:

```ts
registerFrontendTool({
  name: "getWeather",
  description: "Get the current weather for a city",
  parameters: z.object({ city: z.string() }),
  component: WeatherCardComponent,
  handler: async ({ city }, { signal }) => {
    const response = await fetch(`/api/weather?city=${encodeURIComponent(city)}`, {
      signal,
    });
    return response.text();
  },
});
```

Use `registerRenderToolCall` instead when the tool runs on the server and the
browser only renders its call:

```ts
registerRenderToolCall({
  name: "getWeather",
  args: z.object({ city: z.string() }),
  component: WeatherCardComponent,
});
```

Ask the agent for the weather in Paris. The weather card shows "Loading
weather for Paris", then the city and the tool result.

## Next steps [#next-steps]

- [registerFrontendTool API](/reference/angular/functions/registerFrontendTool)
- [registerRenderToolCall API](/reference/angular/functions/registerRenderToolCall)
- [Frontend Tools](/angular/frontend-tools)
- [Other generative UI paths](/angular/generative-ui)
