{'annotations': {'destructiveHint': True,
                 'idempotentHint': False,
                 'openWorldHint': True,
                 'readOnlyHint': False,
                 'title': 'Upsert Rule Group'},
 'description': 'Create or update a rule group.\n'
                '\n'
                'MUTATES STATE depending on storage_mode:\n'
                "- 'yaml_output': Generates YAML only (safe, read-only).\n"
                "- 'k8s_crd': Applies PrometheusRule CRD to Kubernetes "
                'cluster.\n'
                "- 'http_ruler': Pushes to Mimir/Cortex/Thanos Ruler HTTP "
                'API.\n'
                '\n'
                "**WARNING: 'k8s_crd' and 'http_ruler' modes modify external "
                'state.**\n'
                '\n'
                'Returns:\n'
                '- {"group_name": str, "storage_mode": str, "yaml": str,\n'
                '   "applied": bool, "notes": str}\n'
                '\n'
                'When NOT to use: For generating recording rule YAML without\n'
                'applying, use prom_create_recording_rule.\n'
                '\n'
                'Prerequisites:\n'
                '- k8s_crd: Prometheus Operator must be installed.\n'
                '- http_ruler: Backend must support Ruler API.\n'
                '\n'
                'Common errors:\n'
                '- Invalid rule syntax: Use prom_check_rule_group to validate '
                'first.',
 'execution': None,
 'icons': None,
 'meta': None,
 'name': 'prom_upsert_rule_group',
 'output_schema': {'additionalProperties': True, 'type': 'object'},
 'parameters': {'additionalProperties': False,
                'properties': {'backend_id': {'description': 'Prometheus '
                                                             'backend ID',
                                              'minLength': 1,
                                              'type': 'string'},
                               'crd_labels': {'anyOf': [{'additionalProperties': {'type': 'string'},
                                                         'type': 'object'},
                                                        {'type': 'null'}],
                                              'default': None,
                                              'description': 'Optional labels '
                                                             'for CRD metadata '
                                                             '(e.g. '
                                                             "{'release': "
                                                             "'kube-prometheus-stack'})"},
                               'ctx': {'description': 'Context object '
                                                      'providing access to MCP '
                                                      'capabilities.\n'
                                                      '\n'
                                                      'This provides a cleaner '
                                                      "interface to MCP's "
                                                      'RequestContext '
                                                      'functionality.\n'
                                                      'It gets injected into '
                                                      'tool and resource '
                                                      'functions that request '
                                                      'it via type hints.\n'
                                                      '\n'
                                                      'To use context in a '
                                                      'tool function, add a '
                                                      'parameter with the '
                                                      'Context type '
                                                      'annotation:\n'
                                                      '\n'
                                                      '```python\n'
                                                      '@server.tool()\n'
                                                      'def my_tool(x: int, '
                                                      'ctx: Context) -> str:\n'
                                                      '    # Log messages to '
                                                      'the client\n'
                                                      '    '
                                                      'ctx.info(f"Processing '
                                                      '{x}")\n'
                                                      '    ctx.debug("Debug '
                                                      'info")\n'
                                                      '    '
                                                      'ctx.warning("Warning '
                                                      'message")\n'
                                                      '    ctx.error("Error '
                                                      'message")\n'
                                                      '\n'
                                                      '    # Report progress\n'
                                                      '    '
                                                      'ctx.report_progress(50, '
                                                      '100)\n'
                                                      '\n'
                                                      '    # Access resources\n'
                                                      '    data = '
                                                      'ctx.read_resource("resource://data")\n'
                                                      '\n'
                                                      '    # Get request info\n'
                                                      '    request_id = '
                                                      'ctx.request_id\n'
                                                      '    client_id = '
                                                      'ctx.client_id\n'
                                                      '\n'
                                                      '    return str(x)\n'
                                                      '```\n'
                                                      '\n'
                                                      'The context parameter '
                                                      'name can be anything as '
                                                      "long as it's annotated "
                                                      'with Context.\n'
                                                      'The context is optional '
                                                      "- tools that don't need "
                                                      'it can omit the '
                                                      'parameter.',
                                       'properties': {},
                                       'type': 'object'},
                               'group_name': {'description': 'Rule group name',
                                              'type': 'string'},
                               'interval': {'anyOf': [{'type': 'string'},
                                                      {'type': 'null'}],
                                            'default': None,
                                            'description': 'Evaluation '
                                                           'interval (e.g. '
                                                           "'1m', '30s')"},
                               'namespace': {'anyOf': [{'type': 'string'},
                                                       {'type': 'null'}],
                                             'default': 'monitoring',
                                             'description': 'Kubernetes '
                                                            'namespace for CRD '
                                                            'mode'},
                               'rules': {'description': 'List of rule '
                                                        'definitions (alert or '
                                                        'recording rules)',
                                         'items': {'additionalProperties': True,
                                                   'type': 'object'},
                                         'type': 'array'},
                               'storage_mode': {'default': 'yaml_output',
                                                'description': 'Storage mode: '
                                                               "'yaml_output' "
                                                               '(returns '
                                                               'YAML), '
                                                               "'k8s_crd' "
                                                               '(applies '
                                                               'PrometheusRule '
                                                               'CRD), '
                                                               "'http_ruler' "
                                                               '(Mimir/Cortex '
                                                               'HTTP API)',
                                                'type': 'string'}},
                'required': ['backend_id', 'group_name', 'rules', 'ctx'],
                'type': 'object'},
 'serializer': None,
 'tags': set(),
 'task_config': {'mode': 'forbidden',
                 'poll_interval': datetime.timedelta(seconds=5)},
 'timeout': None,
 'title': None,
 'version': None}
