Skip to main content
Glama

github_code_security_create_configuration_for_enterprise

Create a code security configuration for an enterprise to enforce security policies across all repositories.

Instructions

Create a code security configuration for an enterprise

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enterpriseYesenterprise
bodyNoRequest body (JSON object)

Implementation Reference

  • The codeSecurityTools array is exported from this file and later registered via server.tool() in src/index.ts. It contains the tool definition.
    // AUTO-GENERATED by scripts/generate.ts — DO NOT EDIT
    import { z } from "zod";
    import { githubRequest } from "../client.js";
    
    export const codeSecurityTools = [
      {
        name: "github_code_security_get_configurations_for_enterprise",
        description: "Get code security configurations for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          per_page: z.number().optional().describe("The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          before: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          after: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/enterprises/${args.enterprise}/code-security/configurations`, undefined, { per_page: args.per_page, before: args.before, after: args.after });
        },
      },
      {
        name: "github_code_security_create_configuration_for_enterprise",
        description: "Create a code security configuration for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("POST", `/enterprises/${args.enterprise}/code-security/configurations`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_get_default_configurations_for_enterprise",
        description: "Get default code security configurations for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/enterprises/${args.enterprise}/code-security/configurations/defaults`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_get_single_configuration_for_enterprise",
        description: "Retrieve a code security configuration of an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_update_enterprise_configuration",
        description: "Update a custom code security configuration for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("PATCH", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_delete_configuration_for_enterprise",
        description: "Delete a code security configuration for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("DELETE", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_attach_enterprise_configuration",
        description: "Attach an enterprise configuration to repositories",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("POST", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}/attach`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_set_configuration_as_default_for_enterprise",
        description: "Set a code security configuration as a default for an enterprise",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("PUT", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}/defaults`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_get_repositories_for_enterprise_configuration",
        description: "Get repositories associated with an enterprise code security configuration",
        inputSchema: z.object({
          enterprise: z.string().describe("enterprise"),
          configuration_id: z.string().describe("configuration_id"),
          per_page: z.number().optional().describe("The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          before: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          after: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          status: z.string().optional().describe("A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.  Can be: `all`, `attached`, `attaching`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise`")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/enterprises/${args.enterprise}/code-security/configurations/${args.configuration_id}/repositories`, undefined, { per_page: args.per_page, before: args.before, after: args.after, status: args.status });
        },
      },
      {
        name: "github_code_security_get_configurations_for_org",
        description: "Get code security configurations for an organization",
        inputSchema: z.object({
          org: z.string().describe("org"),
          target_type: z.enum(["global", "all"]).optional().describe("The target type of the code security configuration"),
          per_page: z.number().optional().describe("The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          before: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          after: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\"")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/orgs/${args.org}/code-security/configurations`, undefined, { target_type: args.target_type, per_page: args.per_page, before: args.before, after: args.after });
        },
      },
      {
        name: "github_code_security_create_configuration",
        description: "Create a code security configuration",
        inputSchema: z.object({
          org: z.string().describe("org"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("POST", `/orgs/${args.org}/code-security/configurations`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_get_default_configurations",
        description: "Get default code security configurations",
        inputSchema: z.object({
          org: z.string().describe("org")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/orgs/${args.org}/code-security/configurations/defaults`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_detach_configuration",
        description: "Detach configurations from repositories",
        inputSchema: z.object({
          org: z.string().describe("org")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("DELETE", `/orgs/${args.org}/code-security/configurations/detach`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_get_configuration",
        description: "Get a code security configuration",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_update_configuration",
        description: "Update a code security configuration",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("PATCH", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_delete_configuration",
        description: "Delete a code security configuration",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("DELETE", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}`, undefined, undefined);
        },
      },
      {
        name: "github_code_security_attach_configuration",
        description: "Attach a configuration to repositories",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("POST", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}/attach`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_set_configuration_as_default",
        description: "Set a code security configuration as a default for an organization",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id"),
          body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("PUT", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}/defaults`, args.body, undefined);
        },
      },
      {
        name: "github_code_security_get_repositories_for_configuration",
        description: "Get repositories associated with a code security configuration",
        inputSchema: z.object({
          org: z.string().describe("org"),
          configuration_id: z.string().describe("configuration_id"),
          per_page: z.number().optional().describe("The number of results per page (max 100). For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          before: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          after: z.string().optional().describe("A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see \"[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api).\""),
          status: z.string().optional().describe("A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.  Can be: `all`, `attached`, `attaching`, `detached`, `removed`, `enforced`, `failed`, `updating`, `removed_by_enterprise`")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/orgs/${args.org}/code-security/configurations/${args.configuration_id}/repositories`, undefined, { per_page: args.per_page, before: args.before, after: args.after, status: args.status });
        },
      },
      {
        name: "github_code_security_get_configuration_for_repository",
        description: "Get the code security configuration associated with a repository",
        inputSchema: z.object({
          owner: z.string().describe("owner"),
          repo: z.string().describe("repo")
        }),
        handler: async (args: Record<string, any>) => {
          return githubRequest("GET", `/repos/${args.owner}/${args.repo}/code-security-configuration`, undefined, undefined);
        },
      },
    ];
  • The handler function for 'github_code_security_create_configuration_for_enterprise'. It makes a POST request to /enterprises/{enterprise}/code-security/configurations with the request body.
    name: "github_code_security_create_configuration_for_enterprise",
    description: "Create a code security configuration for an enterprise",
    inputSchema: z.object({
      enterprise: z.string().describe("enterprise"),
      body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
    }),
    handler: async (args: Record<string, any>) => {
      return githubRequest("POST", `/enterprises/${args.enterprise}/code-security/configurations`, args.body, undefined);
    },
  • Input schema for the tool: requires 'enterprise' (string) and optionally accepts 'body' (record/JSON object).
    inputSchema: z.object({
      enterprise: z.string().describe("enterprise"),
      body: z.record(z.string(), z.unknown()).optional().describe("Request body (JSON object)")
    }),
  • src/index.ts:106-130 (registration)
    Registration loop in src/index.ts where server.tool() is called for each tool object, registering the tool's name, description, inputSchema, and handler with the MCP server.
    const allTools = allToolModules
      .filter((m) => !enabledCategories || enabledCategories.has(m.category))
      .flatMap((m) => m.tools);
    
    for (const tool of allTools) {
      server.tool(
        tool.name,
        tool.description,
        tool.inputSchema.shape as any,
        async (args: any) => {
          try {
            const result = await tool.handler(args as any);
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            const message = err instanceof Error ? err.message : String(err);
            return {
              content: [{ type: "text" as const, text: `Error: ${message}` }],
              isError: true,
            };
          }
        }
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must cover behavioral traits. It only says 'Create' implying a write operation, but lacks details on required permissions, idempotency, or effects. No output schema or return value description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no redundancy. It is concise, but could include more information without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, no annotations, and a complex operation, the description is too sparse. It does not explain what a code security configuration is, what the body should contain, or any side effects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema descriptions are minimal ('enterprise' and 'Request body (JSON object)') and the description adds no extra meaning. The body parameter is vague, no hint of required fields or structure.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action (create) and resource (code security configuration) and scope (for an enterprise). However, it does not distinguish from sibling tools like create_configuration (which might be for org or repo), though the name itself indicates enterprise scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives (e.g., create_configuration for org or repo). No information about prerequisites or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eyalm321/github-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server