# searchLibraries

**Identifier:** `context7_searchLibraries`

**Provider:** [Context7](https://kirha.com/providers/context7.md)

Search for libraries by name and get their Context7 IDs, quality scores, and available versions. Use this tool first to resolve a library name before fetching documentation with getDocumentation.

## Run it with the CLI

```bash
kirha tools run context7_searchLibraries \
  --input '{
    "libraryName": "react",
    "query": "<query>"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "context7_searchLibraries",
  "input": {
    "libraryName": "react",
    "query": "<query>"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "libraryName": {
      "description": "e.g., \"react\", \"nextjs\", \"pandas\"",
      "type": "string"
    },
    "query": {
      "description": "Question or task for relevance ranking",
      "type": "string"
    }
  },
  "required": [
    "libraryName",
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "ids": {
      "description": "Library IDs for use with getDocumentation",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "libraries": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "benchmarkScore": {
            "type": "number"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "stars": {
            "type": "number"
          },
          "state": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "totalSnippets": {
            "type": "number"
          },
          "trustScore": {
            "type": "number"
          },
          "versions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "title"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "libraries",
    "ids"
  ],
  "type": "object"
}
```

## Related tools

Other Context7 tools that this tool refers to, or that refer to it.

- [`getDocumentation`](https://kirha.com/providers/context7/getDocumentation.md)

-----

[All Context7 tools](https://kirha.com/providers/context7.md) · [< Back to tools list](https://kirha.com/tools.md)