Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
218
  • Apple
  • Linux
json-schema.json63.8 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "fileMatch": [ "context.json", "context.yaml" ], "id": "https://ctxgithub.com/", "title": "ContextHub Configuration", "description": "Configuration schema for ContextHub document generator", "type": "object", "oneOf": [ { "required": [ "documents" ] }, { "required": [ "prompts" ] }, { "required": [ "tools" ] } ], "properties": { "$schema": { "type": "string", "description": "URL to the JSON schema for this configuration file" }, "tools": { "type": "array", "description": "List of custom tools to be registered for execution", "items": { "$ref": "#/definitions/tool" } }, "prompts": { "type": "array", "description": "List of prompts to be registered", "items": { "$ref": "#/definitions/prompt" } }, "exclude": { "type": "object", "description": "Global exclusion patterns for filtering files from being included in documents", "properties": { "patterns": { "type": "array", "description": "Glob patterns to exclude files globally (e.g., '**/.env*', '**/*.pem')", "items": { "type": "string" } }, "paths": { "type": "array", "description": "Specific paths to exclude globally (directories or files)", "items": { "type": "string" } } } }, "variables": { "type": "object", "description": "Custom variables to use throughout the configuration", "additionalProperties": { "oneOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" } ] }, "examples": [ { "version": "1.0.0", "project_name": "My Project", "environment": "development", "api_token": "xyz-123-abc" } ] }, "import": { "type": "array", "description": "List of external configuration files to import", "items": { "oneOf": [ { "type": "string", "description": "Path to configuration file (relative to this file) - shorthand format" }, { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "local", "url" ], "description": "Type of import source" }, "description": { "type": "string", "description": "Human-readable description of the import" }, "pathPrefix": { "type": "string", "description": "Path prefix to apply to all source paths in the imported configuration" }, "filter": { "$ref": "#/definitions/importFilter" } }, "allOf": [ { "if": { "properties": { "type": { "const": "local" } } }, "then": { "required": [ "path" ], "properties": { "path": { "type": "string", "description": "Path to configuration file or directory (relative to this file)" }, "format": { "type": "string", "enum": [ "config", "md" ], "description": "Format type: 'config' for YAML/JSON files, 'md' for markdown files with metadata", "default": "config" } } } }, { "if": { "properties": { "type": { "const": "url" } } }, "then": { "required": [ "url" ], "properties": { "url": { "type": "string", "description": "URL to fetch configuration from" }, "ttl": { "type": "integer", "description": "Cache time-to-live in seconds", "default": 300, "minimum": 0 }, "headers": { "type": "object", "description": "HTTP headers to include in the request", "additionalProperties": { "type": "string" } } } } } ] }, { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string", "description": "Path to configuration file or directory (relative to this file)" }, "format": { "type": "string", "enum": [ "config", "md" ], "description": "Format type: 'config' for YAML/JSON files, 'md' for markdown files with metadata", "default": "config" }, "pathPrefix": { "type": "string", "description": "Path prefix to apply to all source paths in the imported configuration" }, "description": { "type": "string", "description": "Human-readable description of the import" }, "docs": { "type": "array", "description": "List of document paths to selectively import (for local imports only)", "items": { "type": "string" } } }, "additionalProperties": false } ] }, "examples": [ { "type": "local", "path": "./prompts", "format": "md", "description": "Import prompts from markdown files" }, { "type": "local", "path": "./config/api.yaml", "format": "config", "pathPrefix": "/api" }, { "path": "./docs", "format": "markdown" }, "./shared/context.yaml" ] }, "settings": { "type": "object", "description": "Global settings for the context generator", "properties": { "modifiers": { "type": "object", "description": "Named modifier configurations that can be referenced by alias" }, "mcp": { "type": "object", "description": "Settings for MCP (Model Context Protocol) integration", "properties": { "servers": { "type": "object", "description": "Pre-defined MCP server configurations", "additionalProperties": { "$ref": "#/definitions/mcpServerConfig" } } } }, "gitlab": { "type": "object", "description": "Settings for GitLab integration", "properties": { "servers": { "type": "object", "description": "Pre-defined GitLab server configurations", "additionalProperties": { "$ref": "#/definitions/gitlabServerConfig" } } } } } }, "documents": { "type": "array", "description": "List of documents to generate", "items": { "$ref": "#/definitions/document" }, "minItems": 1 } }, "definitions": { "importFilter": { "type": "object", "description": "Filter configuration for selective import of prompts", "properties": { "ids": { "type": "array", "description": "List of prompt IDs to import", "items": { "type": "string" } }, "tags": { "type": "object", "description": "Tag-based filtering configuration", "properties": { "include": { "type": "array", "description": "Tags that prompts must have (based on match strategy)", "items": { "type": "string" } }, "exclude": { "type": "array", "description": "Tags that prompts must not have", "items": { "type": "string" } }, "match": { "type": "string", "enum": [ "any", "all" ], "description": "Match strategy: 'any' = OR logic (default), 'all' = AND logic", "default": "any" } } }, "match": { "type": "string", "enum": [ "any", "all" ], "description": "Overall match strategy between different filter types: 'any' = OR logic (default), 'all' = AND logic", "default": "any" } } }, "inputSchema": { "type": "object", "description": "JSON Schema defining arguments that can be provided to tools or other components", "properties": { "type": { "type": "string", "enum": [ "object" ], "default": "object", "description": "Schema type" }, "properties": { "type": "object", "description": "Properties that define the available arguments", "additionalProperties": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "string", "number", "boolean", "array", "object" ], "description": "Data type of the argument" }, "description": { "type": "string", "description": "Human-readable description of the argument" } }, "required": [ "type" ] } }, "required": { "type": "array", "description": "List of arguments that must be provided", "items": { "type": "string" } } }, "required": [ "properties" ] }, "tool": { "type": "object", "required": [ "id", "description" ], "properties": { "id": { "type": "string", "description": "Unique identifier for the tool" }, "description": { "type": "string", "description": "Human-readable description of the tool" }, "type": { "type": "string", "enum": [ "run", "http" ], "description": "Type of tool (run = command execution, http = HTTP requests)", "default": "run" }, "schema": { "$ref": "#/definitions/inputSchema", "description": "Schema defining arguments that can be provided to the tool" }, "env": { "type": "object", "description": "Environment variables for command executions", "additionalProperties": { "type": "string" } }, "commands": { "type": "array", "description": "List of commands to execute (for 'run' type tools)", "items": { "$ref": "#/definitions/toolCommand" } }, "requests": { "type": "array", "description": "List of HTTP requests to execute (for 'http' type tools)", "items": { "$ref": "#/definitions/httpRequest" } } }, "allOf": [ { "if": { "properties": { "type": { "const": "run" } } }, "then": { "required": [ "commands" ] } }, { "if": { "properties": { "type": { "const": "http" } } }, "then": { "required": [ "requests" ] } } ] }, "httpRequest": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "URL to send the request to, may contain {{argument}} placeholders" }, "method": { "type": "string", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS" ], "description": "HTTP method to use", "default": "GET" }, "headers": { "type": "object", "description": "HTTP headers to send with the request, values may contain {{argument}} placeholders", "additionalProperties": { "type": "string" } }, "query": { "type": "object", "description": "Query parameters to append to the URL, values may contain {{argument}} placeholders", "additionalProperties": { "type": "string" } }, "body": { "oneOf": [ { "type": "string", "description": "Request body as string, may contain {{argument}} placeholders" }, { "type": "object", "description": "Request body as JSON object, values may contain {{argument}} placeholders", "additionalProperties": true } ], "description": "Request body for POST, PUT, etc." } } }, "toolCommand": { "type": "object", "required": [ "cmd" ], "properties": { "cmd": { "type": "string", "description": "Command to execute" }, "args": { "type": "array", "description": "Command arguments, may contain {{argument}} placeholders or conditional arguments", "items": { "oneOf": [ { "type": "string" }, { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "Argument name or value" }, "when": { "type": "string", "description": "Conditional expression that determines if the argument should be included, typically using {{argument}} syntax" } } } ] } }, "workingDir": { "type": "string", "description": "Working directory for command execution (relative to project root), may contain {{argument}} placeholders" }, "env": { "type": "object", "description": "Environment variables for command execution, values may contain {{argument}} placeholders", "additionalProperties": { "type": "string" } } } }, "prompt": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "Unique identifier for the prompt" }, "tags": { "type": "array", "description": "List of tags for this prompt", "items": { "type": "string" } }, "description": { "type": "string", "description": "Human-readable description of the prompt" }, "type": { "type": "string", "enum": [ "prompt", "template" ], "description": "Type of prompt (regular prompt or template)", "default": "prompt" }, "schema": { "$ref": "#/definitions/inputSchema", "description": "Defines input parameters for this prompt" }, "messages": { "type": "array", "description": "List of messages that define the prompt", "items": { "type": "object", "required": [ "role", "content" ], "properties": { "role": { "type": "string", "enum": [ "user", "assistant" ], "description": "The role of the message sender" }, "content": { "type": "string", "description": "The content of the message, may contain variable placeholders like ${variableName} or {{variableName}}" } } } }, "extend": { "type": "array", "description": "List of templates to extend", "items": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "string", "description": "ID of the template to extend" }, "arguments": { "type": "object", "description": "Arguments to pass to the template", "additionalProperties": { "type": "string" } } } } } }, "allOf": [ { "if": { "properties": { "type": { "const": "prompt" } } }, "then": { "anyOf": [ { "required": [ "messages" ] }, { "required": [ "extend" ] } ] } }, { "if": { "properties": { "type": { "const": "template" } } }, "then": { "required": [ "messages" ] } } ] }, "document": { "type": "object", "required": [ "description", "outputPath", "sources" ], "properties": { "description": { "type": "string", "description": "Human-readable description of the document" }, "outputPath": { "type": "string", "description": "Path where the document will be saved", "pattern": "^[\\w\\-./]+\\.[\\w]+$" }, "overwrite": { "type": "boolean", "description": "Whether to overwrite existing files", "default": true }, "sources": { "type": "array", "description": "List of content sources for this document", "items": { "$ref": "#/definitions/source" } }, "modifiers": { "$ref": "#/definitions/modifiers" }, "tags": { "type": "array", "description": "List of tags for a document", "items": { "type": "string" } } } }, "source": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "file", "url", "text", "github", "gitlab", "git_diff", "tree", "mcp", "composer", "docs" ], "description": "Type of content source" }, "description": { "type": "string", "description": "Human-readable description of the source" }, "modifiers": { "$ref": "#/definitions/modifiers" }, "tags": { "type": "array", "description": "List of tags for this source", "items": { "type": "string" } } }, "anyOf": [ { "if": { "properties": { "type": { "const": "file" } } }, "then": { "$ref": "#/definitions/fileSource" } }, { "if": { "properties": { "type": { "const": "url" } } }, "then": { "$ref": "#/definitions/urlSource" } }, { "if": { "properties": { "type": { "const": "text" } } }, "then": { "$ref": "#/definitions/textSource" } }, { "if": { "properties": { "type": { "const": "github" } } }, "then": { "$ref": "#/definitions/githubSource" } }, { "if": { "properties": { "type": { "const": "gitlab" } } }, "then": { "$ref": "#/definitions/gitlabSource" } }, { "if": { "properties": { "type": { "const": "git_diff" } } }, "then": { "$ref": "#/definitions/gitDiffSource" } }, { "if": { "properties": { "type": { "const": "composer" } } }, "then": { "$ref": "#/definitions/composerSource" } }, { "if": { "properties": { "type": { "const": "mcp" } } }, "then": { "$ref": "#/definitions/mcpSource" } }, { "if": { "properties": { "type": { "const": "tree" } } }, "then": { "$ref": "#/definitions/treeSource" } }, { "if": { "properties": { "type": { "const": "docs" } } }, "then": { "$ref": "#/definitions/docsSource" } } ] }, "filePattern": { "oneOf": [ { "type": "string", "description": "Pattern to match files (e.g., *.php)" }, { "type": "array", "description": "List of patterns to match files (e.g., ['*.php', '*.md'])", "items": { "type": "string", "enum": [ "*.php", "*.md", "*.txt", "*.json", "*.xml", "*.html", "*.css", "*.js" ] } } ] }, "sourcePaths": { "oneOf": [ { "type": "string", "description": "Path to file or directory" }, { "type": "array", "description": "List of paths to files or directories", "items": { "type": "string" } } ] }, "patternConstraint": { "oneOf": [ { "type": "string", "description": "Pattern constraint" }, { "type": "array", "description": "List of pattern constraints", "items": { "type": "string" } } ] }, "treeViewConfig": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Whether to show the tree view", "default": true }, "showSize": { "type": "boolean", "description": "Include file/directory sizes in the tree", "default": false }, "showLastModified": { "type": "boolean", "description": "Include last modified dates in the tree", "default": false }, "showCharCount": { "type": "boolean", "description": "Include character counts in the tree", "default": false }, "includeFiles": { "type": "boolean", "description": "Whether to include files in the tree or only directories", "default": true }, "maxDepth": { "type": "integer", "description": "Maximum depth of the tree to display (0 for unlimited)", "minimum": 0, "default": 0 }, "dirContext": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Optional context/descriptions for specific directories" } } }, "fileSource": { "required": [ "sourcePaths" ], "properties": { "sourcePaths": { "$ref": "#/definitions/sourcePaths" }, "filePattern": { "$ref": "#/definitions/filePattern", "default": "*.*" }, "excludePatterns": { "type": "array", "description": "Patterns to exclude files (alias for notPath)", "items": { "type": "string" }, "default": [] }, "notPath": { "type": "array", "description": "Patterns to exclude files by path", "items": { "type": "string" }, "default": [] }, "path": { "$ref": "#/definitions/patternConstraint" }, "contains": { "$ref": "#/definitions/patternConstraint" }, "notContains": { "$ref": "#/definitions/patternConstraint" }, "size": { "$ref": "#/definitions/patternConstraint" }, "date": { "$ref": "#/definitions/patternConstraint" }, "ignoreUnreadableDirs": { "type": "boolean", "description": "Whether to ignore unreadable directories", "default": false }, "showTreeView": { "type": "boolean", "description": "Whether to show directory tree", "default": true }, "treeView": { "oneOf": [ { "type": "boolean", "description": "Whether to show the tree view" }, { "$ref": "#/definitions/treeViewConfig" } ], "description": "Tree view configuration" }, "modifiers": { "$ref": "#/definitions/modifiers" } } }, "urlSource": { "required": [ "urls" ], "properties": { "urls": { "type": "array", "description": "List of URLs to fetch content from", "items": { "type": "string", "format": "uri" }, "minItems": 1 }, "selector": { "type": "string", "description": "CSS selector to extract specific content (null for full page)" }, "headers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Custom HTTP headers to send with requests" } } }, "textSource": { "required": [ "content" ], "properties": { "content": { "type": "string", "description": "Text content" }, "tag": { "type": "string", "description": "Tag to help LLM understand the content. By default, it is set to 'instruction'.", "default": "instruction" } } }, "githubSource": { "required": [ "repository", "sourcePaths" ], "properties": { "repository": { "type": "string", "description": "GitHub repository in format owner/repo", "pattern": "^[\\w.-]+/[\\w.-]+$" }, "sourcePaths": { "$ref": "#/definitions/sourcePaths" }, "branch": { "type": "string", "description": "Branch or tag to fetch from", "default": "main" }, "filePattern": { "$ref": "#/definitions/filePattern", "default": "*.php" }, "excludePatterns": { "type": "array", "description": "Patterns to exclude files", "items": { "type": "string" }, "default": [] }, "showTreeView": { "type": "boolean", "description": "Whether to show directory tree", "default": true }, "githubToken": { "type": "string", "description": "GitHub API token for private repositories (can use env var pattern ${TOKEN_NAME})" } } }, "gitlabSource": { "required": [ "repository", "sourcePaths" ], "properties": { "repository": { "type": "string", "description": "GitLab repository in format group/project", "pattern": "^[\\w.-]+/[\\w.-]+$" }, "sourcePaths": { "$ref": "#/definitions/sourcePaths" }, "branch": { "type": "string", "description": "Branch or tag to fetch from", "default": "main" }, "filePattern": { "$ref": "#/definitions/filePattern", "default": "*.*" }, "excludePatterns": { "type": "array", "description": "Patterns to exclude files (alias for notPath)", "items": { "type": "string" }, "default": [] }, "notPath": { "type": "array", "description": "Patterns to exclude files by path", "items": { "type": "string" }, "default": [] }, "path": { "$ref": "#/definitions/patternConstraint" }, "contains": { "$ref": "#/definitions/patternConstraint" }, "notContains": { "$ref": "#/definitions/patternConstraint" }, "showTreeView": { "type": "boolean", "description": "Whether to show directory tree", "default": true }, "treeView": { "oneOf": [ { "type": "boolean", "description": "Whether to show the tree view" }, { "$ref": "#/definitions/treeViewConfig" } ], "description": "Tree view configuration" }, "server": { "oneOf": [ { "type": "string", "description": "Reference to a pre-defined server in settings.gitlab.servers" }, { "$ref": "#/definitions/gitlabServerConfig" } ], "description": "GitLab server configuration or reference to a pre-defined server" }, "modifiers": { "$ref": "#/definitions/modifiers" } } }, "gitlabServerConfig": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "description": "GitLab server URL" }, "token": { "type": "string", "description": "GitLab API token for authentication (can use env var pattern ${TOKEN_NAME})" }, "headers": { "type": "object", "description": "Custom HTTP headers to send with requests", "additionalProperties": { "type": "string" } } } }, "gitDiffSource": { "properties": { "repository": { "type": "string", "description": "Path to the git repository" }, "render": { "$ref": "#/definitions/gitDiffRender", "description": "Configuration for rendering diffs" }, "commit": { "type": "string", "enum": [ "last", "last-5", "last-10", "last-week", "last-month", "unstaged", "staged", "wip", "main-diff", "master-diff", "develop-diff", "today", "last-24h", "yesterday", "last-2weeks", "last-quarter", "last-year", "stash", "stash-last", "stash-1", "stash-2", "stash-3", "stash-all", "stash-latest-2", "stash-latest-3", "stash-latest-5", "stash-before-pull", "stash-wip", "stash-untracked", "stash-index" ], "description": "Git commit range (e.g., 'HEAD~5..HEAD')", "default": "staged" }, "filePattern": { "oneOf": [ { "type": "string", "description": "Pattern to match files (e.g., *.php)" }, { "type": "array", "description": "List of patterns to match files (e.g., ['*.php', '*.md'])", "items": { "type": "string" } } ], "default": "*.*" }, "path": { "oneOf": [ { "type": "string", "description": "Pattern to include only files in specific paths" }, { "type": "array", "description": "List of patterns to include only files in specific paths", "items": { "type": "string" } } ], "default": [] }, "notPath": { "type": "array", "description": "Patterns to exclude files by path", "items": { "type": "string" }, "default": [] }, "contains": { "oneOf": [ { "type": "string", "description": "Pattern to include only diffs containing specific content" }, { "type": "array", "description": "List of patterns to include only diffs containing specific content", "items": { "type": "string" } } ], "default": [] }, "notContains": { "oneOf": [ { "type": "string", "description": "Pattern to exclude diffs containing specific content" }, { "type": "array", "description": "List of patterns to exclude diffs containing specific content", "items": { "type": "string" } } ], "default": [] }, "showStats": { "type": "boolean", "description": "Whether to show commit stats in output", "default": true }, "modifiers": { "$ref": "#/definitions/modifiers" } } }, "gitDiffRender": { "oneOf": [ { "type": "object", "properties": { "strategy": { "type": "string", "enum": [ "raw", "llm" ], "description": "The strategy to use for rendering diffs", "default": "raw" }, "showStats": { "type": "boolean", "description": "Whether to show file stats in the output", "default": true }, "showLineNumbers": { "type": "boolean", "description": "Whether to show line numbers in diff output", "default": false }, "contextLines": { "type": "integer", "description": "Number of context lines to show around changes", "minimum": 0, "default": 3 } } }, { "type": "string", "enum": [ "raw", "llm" ], "description": "The strategy to use for rendering diffs (shorthand)" } ], "description": "Configuration for rendering diffs" }, "docsSource": { "type": "object", "description": "Source for documentation content", "required": [ "type", "library", "topic" ], "properties": { "type": { "type": "string", "enum": [ "docs" ], "description": "Source type - docs" }, "library": { "type": "string", "description": "Library identifier (e.g., \"laravel/docs\")" }, "topic": { "type": "string", "description": "Topic to search for within the library" }, "tokens": { "type": "integer", "default": 500, "description": "Maximum token count to retrieve" }, "description": { "type": "string", "description": "Human-readable description of the source" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "List of tags for this source" } }, "additionalProperties": false }, "treeSource": { "description": "Generates a hierarchical visualization of directory structures", "properties": { "type": { "type": "string", "const": "tree", "description": "Source type identifier" }, "description": { "type": "string", "description": "Human-readable description of the source" }, "sourcePaths": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Path(s) to generate tree from" }, "filePattern": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Pattern(s) to match files" }, "notPath": { "type": "array", "items": { "type": "string" }, "description": "Patterns to exclude from the tree" }, "path": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Patterns to include only specific paths" }, "contains": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Include files containing specific content" }, "notContains": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Exclude files containing specific content" }, "maxDepth": { "type": "integer", "minimum": 0, "description": "Maximum depth of the tree to display (0 for unlimited)" }, "includeFiles": { "type": "boolean", "default": true, "description": "Whether to include files in the tree or only directories" }, "showSize": { "type": "boolean", "default": false, "description": "Include file/directory sizes in the tree" }, "showCharCount": { "type": "boolean", "default": false, "description": "Include character counts in the tree" }, "showLastModified": { "type": "boolean", "default": false, "description": "Include last modified dates in the tree" }, "dirContext": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Optional context/descriptions for specific directories" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Tags to categorize or filter sources" } }, "required": [ "type", "sourcePaths" ] }, "composerSource": { "properties": { "composerPath": { "type": "string", "description": "Path to composer.json file or directory containing it" }, "packages": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Package names to include (e.g., 'vendor/package')" }, "filePattern": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "File pattern(s) to match" }, "notPath": { "type": "array", "items": { "type": "string" }, "description": "Patterns to exclude files" }, "path": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Patterns to include only specific paths" }, "maxFiles": { "type": [ "integer" ], "description": "Maximum number of files to include (0 for no limit)", "minimum": 0, "default": 0 }, "contains": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Patterns to include files containing specific content" }, "notContains": { "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Patterns to exclude files containing specific content" }, "includeDevDependencies": { "type": "boolean", "description": "Whether to include dev dependencies" }, "showTreeView": { "type": "boolean", "description": "Whether to show directory tree visualization" }, "treeView": { "oneOf": [ { "type": "boolean", "description": "Whether to show the tree view" }, { "$ref": "#/definitions/treeViewConfig" } ], "description": "Tree view configuration" }, "modifiers": { "$ref": "#/definitions/modifiers" } } }, "mcpSource": { "required": [ "server", "operation" ], "properties": { "server": { "oneOf": [ { "type": "string", "description": "Reference to a pre-defined server in settings.mcp.servers" }, { "$ref": "#/definitions/mcpServerConfig" } ] }, "operation": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "resource.read", "tool.call" ], "description": "Type of operation to execute on the MCP server" } }, "allOf": [ { "if": { "properties": { "type": { "const": "resource.read" } } }, "then": { "required": [ "resources" ], "properties": { "resources": { "type": "array", "description": "List of resource URIs to read", "items": { "type": "string" }, "minItems": 1 } } } }, { "if": { "properties": { "type": { "const": "tool.call" } } }, "then": { "required": [ "name" ], "properties": { "name": { "type": "string", "description": "Name of the tool to call" }, "arguments": { "type": "object", "description": "Arguments to pass to the tool", "additionalProperties": true } } } } ] } } }, "php-content-filter": { "type": "object", "properties": { "include_methods": { "type": "array", "items": { "type": "string" }, "description": "Method names to include (empty means include all unless exclude_methods is set)" }, "exclude_methods": { "type": "array", "items": { "type": "string" }, "description": "Method names to exclude" }, "include_properties": { "type": "array", "items": { "type": "string" }, "description": "Property names to include" }, "exclude_properties": { "type": "array", "items": { "type": "string" }, "description": "Property names to exclude" }, "include_constants": { "type": "array", "items": { "type": "string" }, "description": "Constant names to include" }, "exclude_constants": { "type": "array", "items": { "type": "string" }, "description": "Constant names to exclude" }, "method_visibility": { "$ref": "#/definitions/visibilityOptions", "description": "Method visibilities to include" }, "property_visibility": { "$ref": "#/definitions/visibilityOptions", "description": "Property visibilities to include" }, "constant_visibility": { "$ref": "#/definitions/visibilityOptions", "description": "Constant visibilities to include" }, "keep_method_bodies": { "type": "boolean", "description": "Whether to keep method bodies or replace with placeholders" }, "method_body_placeholder": { "type": "string", "description": "Placeholder for method bodies when keep_method_bodies is false" }, "keep_doc_comments": { "type": "boolean", "description": "Whether to keep doc comments" }, "keep_attributes": { "type": "boolean", "description": "Whether to keep PHP 8+ attributes" }, "include_methods_pattern": { "type": "string", "description": "Regex pattern for methods to include" }, "exclude_methods_pattern": { "type": "string", "description": "Regex pattern for methods to exclude" }, "include_properties_pattern": { "type": "string", "description": "Regex pattern for properties to include" }, "exclude_properties_pattern": { "type": "string", "description": "Regex pattern for properties to exclude" } } }, "php-docs": { "type": "object", "properties": { "include_private_methods": { "type": "boolean", "description": "Whether to include private methods in documentation", "default": false }, "include_protected_methods": { "type": "boolean", "description": "Whether to include protected methods in documentation", "default": true }, "include_private_properties": { "type": "boolean", "description": "Whether to include private properties in documentation", "default": false }, "include_protected_properties": { "type": "boolean", "description": "Whether to include protected properties in documentation", "default": true }, "include_implementations": { "type": "boolean", "description": "Whether to include method implementations in code blocks", "default": true }, "include_property_defaults": { "type": "boolean", "description": "Whether to include property default values", "default": true }, "include_constants": { "type": "boolean", "description": "Whether to include class constants", "default": true }, "code_block_format": { "type": "string", "description": "Language identifier for code blocks (e.g., 'php')", "default": "php" }, "class_heading_level": { "type": "integer", "description": "Heading level for class names (1-6)", "minimum": 1, "maximum": 6, "default": 1 }, "extract_routes": { "type": "boolean", "description": "Whether to extract route information from annotations/attributes", "default": true }, "keep_doc_comments": { "type": "boolean", "description": "Whether to keep doc comments in the output", "default": true } } }, "sanitizer": { "type": "object", "properties": { "rules": { "type": "array", "description": "Array of sanitization rules to apply", "items": { "type": "object", "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "keyword" ], "description": "Keyword removal rule" }, "name": { "type": "string", "description": "Optional unique rule name" }, "keywords": { "type": "array", "items": { "type": "string" }, "description": "Array of keywords to search for and remove" }, "replacement": { "type": "string", "description": "Text to replace the found keywords with" }, "caseSensitive": { "type": "boolean", "description": "Whether matching should be case-sensitive" }, "removeLines": { "type": "boolean", "description": "Whether to remove entire lines containing the keyword" } }, "required": [ "type", "keywords" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "regex" ], "description": "Regular expression replacement rule" }, "name": { "type": "string", "description": "Optional unique rule name" }, "patterns": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Object mapping regex patterns to their replacements" }, "usePatterns": { "type": "array", "items": { "type": "string", "enum": [ "credit-card", "email", "api-key", "ip-address", "jwt", "phone-number", "password-field", "url", "social-security", "aws-key", "private-key", "database-conn" ] }, "description": "Predefined pattern aliases to use" } }, "required": [ "type" ] }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "comment" ], "description": "Comment insertion rule" }, "name": { "type": "string", "description": "Optional unique rule name" }, "fileHeaderComment": { "type": "string", "description": "Comment to insert at the top of file" }, "classComment": { "type": "string", "description": "Comment to insert before class definitions" }, "methodComment": { "type": "string", "description": "Comment to insert before method definitions" }, "frequency": { "type": "integer", "minimum": 0, "description": "How often to insert random comments (0 = disabled, 1 = every line, 5 = every 5th line)" }, "randomComments": { "type": "array", "items": { "type": "string" }, "description": "Array of random comments to insert" } }, "required": [ "type" ] } ], "required": [ "type" ] } } } }, "modifiers": { "type": "array", "description": "List of content modifiers to apply", "items": { "oneOf": [ { "type": "string", "description": "Modifier identifier or alias" }, { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string", "description": "Modifier identifier", "enum": [ "php-content-filter", "php-docs", "sanitizer" ] }, "options": { "description": "Modifier options", "allOf": [ { "if": { "properties": { "name": { "const": "php-content-filter" } } }, "then": { "$ref": "#/definitions/php-content-filter" } }, { "if": { "properties": { "name": { "const": "php-docs" } } }, "then": { "$ref": "#/definitions/php-docs" } }, { "if": { "properties": { "name": { "const": "sanitizer" } } }, "then": { "$ref": "#/definitions/sanitizer" } } ] } } } ] } }, "visibilityOptions": { "type": "array", "items": { "type": "string", "enum": [ "public", "protected", "private" ] } }, "mcpServerConfig": { "oneOf": [ { "required": [ "command" ], "properties": { "command": { "type": "string", "description": "Command to execute to start the MCP server" }, "args": { "type": "array", "description": "Command arguments", "items": { "type": "string" } }, "env": { "type": "object", "description": "Environment variables for the command", "additionalProperties": { "type": "string" } } } }, { "required": [ "url" ], "properties": { "url": { "type": "string", "description": "URL of the MCP server", "format": "uri" }, "headers": { "type": "object", "description": "HTTP headers to send with requests", "additionalProperties": { "type": "string" } } } } ] } } }

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/context-hub/generator'

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