# CodeReferences (*codeReferences*) ## Overview ### Available Operations * [listRepositories](#listrepositories) - List repositories ## listRepositories Get a list of connected repositories. Optionally, you can include branch metadata with the `withBranches` query parameter. Embed references for the default branch with `ReferencesForDefaultBranch`. You can also filter the list of code references by project key and flag key. ### Example Usage ```typescript import { LaunchDarkly } from "@launchdarkly/mcp-server"; const launchDarkly = new LaunchDarkly({ apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", }); async function run() { const result = await launchDarkly.codeReferences.listRepositories({}); console.log(result); } run(); ``` ### Standalone function The standalone function version of this method: ```typescript import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; import { codeReferencesListRepositories } from "@launchdarkly/mcp-server/funcs/codeReferencesListRepositories.js"; // Use `LaunchDarklyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. const launchDarkly = new LaunchDarklyCore({ apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", }); async function run() { const res = await codeReferencesListRepositories(launchDarkly, {}); if (res.ok) { const { value: result } = res; console.log(result); } else { console.log("codeReferencesListRepositories failed:", res.error); } } run(); ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `request` | [operations.GetRepositoriesRequest](../../models/operations/getrepositoriesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.RepositoryCollectionRep](../../models/components/repositorycollectionrep.md)\>** ### Errors | Error Type | Status Code | Content Type | | --------------------------- | --------------------------- | --------------------------- | | errors.UnauthorizedErrorRep | 401 | application/json | | errors.ForbiddenErrorRep | 403 | application/json | | errors.RateLimitedErrorRep | 429 | application/json | | errors.APIError | 4XX, 5XX | \*/\* |