# llm\_call\_tool

#### `llm_call_tool`: Direct Tool Invocation

Explicitly instructs the language model to use specified tools with user input.

```python
def llm_call_tool(
    agent_name: str, 
    messages: List[Dict[str, Any]], 
    tools: List[Dict[str, Any]], 
    base_url: str = aios_kernel_url,
    llms: List[Dict[str, Any]] = None
) -> LLMResponse
```

**Parameters:**

* `agent_name`: Identifier for the agent making the request
* `messages`: List of message dictionaries
* `tools`: List of available tools and their specifications
* `base_url`: API endpoint URL
* `llms`: Optional list of LLM configurations

**Returns:**

* `LLMResponse` object containing tool calls and their results

**Example:**

```python
# Use weather tool to get forecast
response = llm_call_tool(
    "weather_agent",
    messages=[
        {"role": "user", "content": "What's the weather like in New York today?"}
    ],
    tools=[{
        "name": "weather_service/get_forecast",
        "description": "Get weather forecast for a location",
        "parameters": {
            "type": "object",
            "properties": {
                "location": {"type": "string"},
                "units": {"type": "string", "enum": ["metric", "imperial"]}
            },
            "required": ["location"]
        }
    }]
)

# Process the tool response
print(response["response"]["response_message"])
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aios.foundation/aios-docs/aios-agent-sdk/llm-core-api/llm_call_tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
