> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-commands-guide/xql-library-commands.md).

# XQL Library Commands

* [getXQLLibraries](#getxqllibraries)
* [createXQLLibraries](#createxqllibraries)
* [deleteXQLLibraries](#deletexqllibraries)

#### getXQLLibraries

***

Gets a list of saved XQL library queries. XQL library queries are reusable named queries that can be referenced from other XQL queries.

<details>

<summary>Arguments</summary>

| Argument Name    | Description                                                                                                   | Required |
| ---------------- | ------------------------------------------------------------------------------------------------------------- | -------- |
| extra\_data      | Whether to include extra data in the response. possible values: true, false Possible values are: true, false. | Optional |
| xql\_query\_name | The name of the XQL query to retrieve.                                                                        | Optional |
| xql\_query\_tag  | The tag of the XQL query to retrieve.                                                                         | Optional |

</details>

<details>

<summary>Outputs</summary>

**Core.xqlLibraries.xql\_query\_name** *string*

The name of the XQL query.

**Core.xqlLibraries.xql\_query** *string*

The XQL query content.

**Core.xqlLibraries.xql\_query\_tags** *string*

The tags of the XQL query.

</details>

#### createXQLLibraries

***

Creates and saves an XQL library query, a reusable named query that can be referenced from other XQL queries.

<details>

<summary>Arguments</summary>

| Argument Name      | Description                                                                                          | Required |
| ------------------ | ---------------------------------------------------------------------------------------------------- | -------- |
| override\_existing | Whether to override existing queries. possible values: true, false Possible values are: true, false. | Optional |
| xql\_query         | The XQL query content.                                                                               | Required |
| xql\_query\_name   | The name of the XQL query.                                                                           | Required |
| xql\_query\_tag    | The tag of the XQL query.                                                                            | Optional |

</details>

**Outputs**

There are no outputs for this command.

#### deleteXQLLibraries

***

Deletes a saved XQL library query. Any other query still referencing the deleted library query will fail.

<details>

<summary>Arguments</summary>

| Argument Name    | Description                          | Required |
| ---------------- | ------------------------------------ | -------- |
| xql\_query\_name | The name of the XQL query to delete. | Optional |
| xql\_query\_tag  | The tag of the XQL query to delete.  | Optional |

</details>

**Outputs**

There are no outputs for this command.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-commands-guide/xql-library-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
